provideElements
Offers a declarative approach to register Angular Elements.
Notes
The returned providers are for
only, e.g. app.config.ts
, route declarations, and NgModules. The registered Angular Elements will not be unregistered when the
is destroyed, so make sure the
will not be destroyed anytime in the application's lifecycle.
Presentation
function provideElements (config : ProvideElementsConfig ): EnvironmentProviders ;
Returns
Parameters
Name | Type | Description |
---|---|---|
config |
|
Example usage
export const APP_ELEMENTS: Elements = {
'my-button': ButtonComponent,
'my-icon': IconComponent,
'my-icon-button': IconButtonComponent,
};
providers: [
provideElements ({ elements: APP_ELEMENTS }),
]