【发布时间】:2022-01-10 17:21:13
【问题描述】:
我有这个代码
<div>
<wizard-step
[component]="'ExampleComponent'"
></wizard-step>
</div>
ExampleComponent 是我想在组件中提取的一个组件,但是在使用组件变量时,结果是一个字符串,我想从该名称中获取 Component 对象。
感谢您的帮助。
【问题讨论】:
-
对我来说,你想要实现的目标有点不清楚
-
我想获取 ExampleComponent 作为组件对象而不是字符串
-
如果你想在另一个组件模板中添加一个组件模板,请使用
angular.io/guide/content-projection
标签: html css angular typescript