我用的是Angular 17.0.0-next.6的最新版本,它增加了对新控制流的支持,我在Twitter上看到人们说它对他们来说很好,所以这一定是我的问题
我按照预期在新项目中使用了所有内容,并用下面的代码替换了app.Component.html
@if(title) {
title
} @else {
no title
}
但它给了我以下错误
X [ERROR] NG5002: Invalid ICU message. Missing '}'. [plugin angular-compiler]
src/app/app.component.html:6:0:
6 │
╵ ^
Error occurs in the template of component AppComponent.
src/app/app.component.ts:9:15:
9 │ templateUrl: './app.component.html',
╵ ~~~~~~~~~~~~~~~~~~~~~~
X [ERROR] NG5002: Unexpected character "EOF" (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.) [plugin angular-compiler]
src/app/app.component.html:6:0:
6 │
╵ ^
Error occurs in the template of component AppComponent.
src/app/app.component.ts:9:15:
9 │ templateUrl: './app.component.html',
╵ ~~~~~~~~~~~~~~~~~~~~~~
stackblitz的链接