angular - 当我将 Angular 12 服务器与 PUG 集成时崩溃
问题描述
我一直在尝试设置我的 Angular 12 应用程序代码库以使用 PUG 模板引擎。我已经运行了这个命令ng add ng-cli-pug-loader
,然后将我的.html
文件转换为.pug
. 在保存更改时,Angular 服务器崩溃了,在控制台中给了我这个错误。
Error: src/app/app.component.pug:26:2 - error NG5002: Unexpected character "EOF" (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.)
26 ;
src/app/app.component.ts:5:16
5 templateUrl: './app.component.pug',
~~~~~~~~~~~~~~~~~~~~~
Error occurs in the template of component AppComponent.
app.component.pug
只有一行h1 test this code display
解决方案
推荐阅读
- python - AttributeError:模块'numbers'在scripy中没有属性'Integral'
- parsing - 如何在antlr4中使用Listener方法获取解析器的内容?
- python - py2exe 不工作 - 闪烁控制台并关闭
- python - 带有旋转/缩放/剪切/平移提取的 3D 点云配准(知道对应关系)
- javascript - 如何使用双向数据绑定将一个文本替换为另一个文本?
- python - 为什么我的 val_loss 下降但我的 val_accuracy 停滞不前
- ruby-on-rails - 在 kubernetes 中运行 rails + postgres:连接被拒绝
- flutter - 如何在 Firestore 查询中使用 DocumentReference
- c# - 获取程序要连接的 IP 地址
- .net - 如何在 docker 中安装 .net 框架?