【问题标题】:Please add a @Pipe/@Directive/@Component annotation in Angular 6请在 Angular 6 中添加 @Pipe/@Directive/@Component 注释
【发布时间】:2019-01-27 06:35:44
【问题描述】:

在Angular6中,我有一个错误请添加@Pipe/@Directive/@Component注解

我使用 Angular CLI 版本:6.1.4 角度版本:6.1.3 节点:10.9.0 NPM:6.2.0

当我在终端中运行 ng serve 时,它​​已编译但在浏览器 localhost:4200 中尝试其显示的错误。 错误显示在下面的错误中。

输出 enter image description here

【问题讨论】:

  • 你能贴出你的书组件代码吗?
  • 你必须在 appmodule 中添加 bookcomponent。如果这不能解决您的错误,能否分享您的 appmodule 和 bookcomponent 代码?
  • 共享两个文件

标签: node.js npm angular-cli angular6


【解决方案1】:

在我的例子中,我在 AppModule 中声明了一个自定义模块。这是不必要的,因为应用程序路由正在处理自定义模块。只需删除声明即可。希望这对某人有所帮助

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-04-24
    • 2018-03-14
    • 1970-01-01
    • 2021-08-15
    • 1970-01-01
    • 2017-12-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多