【发布时间】:2018-03-05 08:29:08
【问题描述】:
失败:模板解析错误: 'router-outlet' 不是已知元素:
如果 'router-outlet' 是 Angular 组件,则验证它是该模块的一部分。
If 'router-outlet' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("[ERROR ->]<router-outlet></router-outlet>"): ng:///DynamicTestModule/***.html@0:0
angular 4 ng 测试失败:模板解析错误:'router-outlet' 不是已知元素
【问题讨论】:
-
您是否导入了
RouterModule?请提供允许重现问题的代码。 -
是的,已经导入了 RouterModule。但不工作
-
请出示代码
-
@HemantVishwakarma 你能解决你的问题吗?