Angular 7找不到管道 [英] Angular 7 doesn't find pipes

查看:426
本文介绍了Angular 7找不到管道的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建我的Angular 7项目但每次出现错误时都会说

I'm trying to build my Angular 7 project but every time I get an error saying

错误:模板解析错误:
无法找到管道'货币'....

但是当我尝试运行 ng服务它确实按预期工作

But when I try to run the ng serve it does works as expected

我试图用构建它 - -prod 标志,它不起作用。如果我删除了生产标志,它就会正确构建。

I've tried to build it with the --prod flag, and it doesn't work. If I remove the production flag, it build correctly.

推荐答案

试试这个:
in tsconfig.json 更改

"angularCompilerOptions": {
    "enableIvy": true
}

"angularCompilerOptions": {
    "enableIvy": false
}

这篇关于Angular 7找不到管道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆