angular报错:Please add a @Pipe/@Directive/@Component annotation


angular 报错 

ERROR Error: Uncaught (in promise): Error: Unexpected module 'B' declared by the module 'A'. Please add a @Pipe/@Directive/@Component annotation.

当在一个"模块A"文件中导入(import)另一个"模块B"时, 被导入的模块需要添加到当前这个模块的@ngModule修饰器中的imports字段中,如果加到了

declarations的话,就会报上面的错误.
 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM