Function createAll

  • Create all instances of a specific component on the page

    Uses the data-module attribute to find all elements matching the specified component on the page, creating instances of the component object for each of them.

    Any component errors will be caught and logged to the console.

    Type Parameters

    • T extends CompatibleClass

    Parameters

    • Component: T

      class of the component to create

    • Optional config: T["defaults"]

      config for the component

    • Optional $scope: Element | Document = document

      scope of the document to search within

    Returns InstanceType<T>[]

    • array of instantiated components