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

    Parameters

    • Component: T

      class of the component to create

    • Optionalconfig: 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