@angular/elements
Implements Angular's custom-element API, which enables you to package components as custom elements.
A custom element extends HTML by allowing you to define a tag whose content is created and controlled by JavaScript code. The browser maintains a CustomElementRegistry
of defined custom elements (also called Web Components), which maps an instantiable JavaScript class to an HTML tag.
The createCustomElement()
function provides a bridge from Angular's component interface and change detection functionality to the built-in DOM API.
For more information, see Angular Elements Overview.
入口点
主要
@angular/elements | Implements Angular's custom-element API, which enables you to package components as custom elements. |
主入口点的导出
类
NgElement | Implements the functionality needed for a custom element. |
函数
createCustomElement | Creates a custom element class based on an Angular component. |
结构
NgElementConfig | A configuration that initializes an NgElementConstructor with the dependencies and strategy it needs to transform a component into a custom element class. |
NgElementConstructor | Prototype for a class constructor based on an Angular component that can be used for custom element registration. Implemented and returned by the createCustomElement() function. |
NgElementStrategy | Underlying strategy used by the NgElement to create/destroy the component and react to input changes. |
NgElementStrategyEvent | Interface for the events emitted through the NgElementStrategy. |
NgElementStrategyFactory | Factory used to create new strategies for each NgElement instance. |
类型
WithProperties | Additional type information that can be added to the NgElement class, for properties that are added based on the inputs and methods of the underlying component. |