在Angular2 RC4中如何将组件添加到预编译数组?
我刚刚将我的Angular2项目更新为RC4,当我打开我的应用程序时,路由器现在正在控制台中发出此警告消息:
router.umd.js:2466 'FrontpageComponent' not found in precompile array. To ensure all components referred to by the RouterConfig are compiled,you must add 'FrontpageComponent' to the 'precompile' array of your application component. This will be required in a future release of the router. 我试图弄清楚我需要做什么来解决这个问题,但由于文档稀疏,我找不到答案。这是什么预编译数组,哪里可以找到它,或者如何添加它?
在较新的路由器版本中,这不应该是必要的。
< = RC.4 这只是@Component()或@Directive()装饰器的一个附加参数: @Component({ selector: '...',template: '...',directives: [FrontpageComponent],precompile: [FrontpageCmponent] }) https://github.com/angular/angular/blob/6c5b653593eff19c5b9342b2cf0195aca49379cb/modules/%40angular/core/src/metadata/directives.ts#L968
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |