【发布时间】:2019-01-28 06:45:09
【问题描述】:
我必须在我的应用模块中导入一个 javascript 文件
import { OtherComponent } from './node_modules/blahblah/OtherComponent.js'
请注意,此 OtherComponent 已经是一个 javascript 文件。
然后在我的@NgModule 中,我将此组件添加到我的声明中。
当我运行“ng build --prod”时,它给了我错误:
ERROR 模块声明的意外值“OtherComponent” '应用模块'
请添加@Pipe/@Directive/@Component 注解
有没有办法解决这个问题?当我无权访问 OtherComponent 的 ts 文件时。
【问题讨论】:
标签: javascript angular angular6 aot ng-build