@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.
入口点
Entry points
主要
Primary
@angular/elements | Implements Angular's custom-element API, which enables you to package components as custom elements. |
主要入口点的导出
Primary entry point exports
类
Classes
NgElement | 实现自定义元素所需的功能。 Implements the functionality needed for a custom element. |
函数
Functions
createCustomElement | 基于 Angular 组件创建自定义元素类。 Creates a custom element class based on an Angular component. |
结构
Structures
NgElementConfig | 一种配置,它使用将组件转换为自定义元素类所需的依赖项和策略来初始化 NgElementConstructor。 A configuration that initializes an NgElementConstructor with the dependencies and strategy it needs to transform a component into a custom element class. |
NgElementConstructor | 基于 Angular 组件的类构造函数的原型,该原型可用于自定义元素注册。由 createCustomElement() 函数 实现并返回。 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 | NgElement 用来创建/销毁组件并对输入更改做出反应的底层策略。 Underlying strategy used by the NgElement to create/destroy the component and react to input changes. |
NgElementStrategyEvent | 通过 NgElementStrategy 发出的事件的接口。 Interface for the events emitted through the NgElementStrategy. |
NgElementStrategyFactory | 本工厂用于为每个 NgElement 实例创建新策略。 Factory used to create new strategies for each NgElement instance. |
类型
Types
WithProperties | 可以添加到 NgElement 类的其他类型信息,用于基于基础组件的输入和方法添加的属性。 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. |