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的话,就会报上面的错误.
 
posted @ 2019-07-03 16:11  johnjackson  阅读(2571)  评论(0编辑  收藏  举报