【发布时间】:2017-07-07 07:20:18
【问题描述】:
StackOverflow 中有很多帖子提供了比 Angular 2 文档更详细的关于如何在另一个自定义组件中包含自定义组件的详细信息。
但是,即使我按照这些说明进行操作(确保注入的组件位于模块定义的 declarations 块中,并确保注入的组件位于组件定义的 directives 块中),它仍然会抛出一个错误:
Unhandled Promise rejection: Template parse errors:
'test' is not a known element:
1. If 'test' is an Angular component, then verify that it is part of this module.
2. If 'test' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("
</footer>
[ERROR ->]<test></test>
您可以查看Github repo。我从a branch 开始尝试解决问题。
我可能忘记了什么?任何指导表示赞赏。
【问题讨论】:
标签: angular angular2-directives angular2-components