填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

createCustomElement

基于 Angular 组件创建自定义元素类。

Creates a custom element class based on an Angular component.

查看"说明"...

      
      createCustomElement<P>(component: Type<any>, config: NgElementConfig): NgElementConstructor<P>
    
参数
component Type

要转换的组件。

The component to transform.

config NgElementConfig

为创建的类提供初始化信息的配置。

A configuration that provides initialization information to the created class.

返回值

自定义元素的构造类,可以注册到浏览器的 CustomElementRegistry 中。

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

参见

说明

构建一个类,该类封装给定组件的功能,并使用配置信息为该类提供更多上下文。获取组件工厂的输入和输出,以将它们转换为适当的自定义元素 API,并为输入变更添加钩子。

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

这里配置的注入器是在类上设置的初始注入器,默认情况下用于每个创建的实例。此行为可以用静态属性覆盖以影响所有新创建的实例,也可以用作一次性创建的构造函数参数。

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