首页 > 解决方案 > 当我将 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

标签: angular

解决方案


推荐阅读