{ "id": "api/elements/createCustomElement", "title": "createCustomElement", "contents": "\n\n
\n
\n
\n \n API > @angular/elements\n
\n \n
\n \n
\n

createCustomElementlink

\n \n \n \n \n \n
\n \n \n\n
\n \n
\n

Creates a custom element class based on an Angular component.

\n\n

See more...

\n
\n \n \n \n\n
\n \n\n createCustomElement<P>(component: Type<any>, config: NgElementConfig): NgElementConstructor<P>\n\n \n\n
Parameters
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n component\n Type\n

The component to transform.

\n\n
\n \n config\n NgElementConfig\n

A configuration that provides initialization information to the created class.

\n\n
\n\n \n
Returns
\n

NgElementConstructor<P>: The custom-element construction class, which can be registered with\na browser's CustomElementRegistry.

\n\n \n\n\n \n\n \n
\n\n\n \n
\n

See alsolink

\n \n
\n\n\n \n\n
\n

Descriptionlink

\n

Builds a class that encapsulates the functionality of the provided component and\nuses the configuration information to provide more context to the class.\nTakes the component factory's inputs and outputs to convert them to the proper\ncustom element API and add hooks to input changes.

\n

The configuration's injector is the initial injector set on the class,\nand used by default for each created instance.This behavior can be overridden with the\nstatic property to affect all newly created instances, or as a constructor argument for\none-off creations.

\n\n \n
\n\n\n\n \n\n\n
\n
\n\n\n" }