gpt4 book ai didi

Angular 2 模板解析错误 Missing expected )

转载 作者:行者123 更新时间:2023-12-02 00:48:24 25 4
gpt4 key购买 nike

我收到以下异常:

Unhandled Promise rejection: Template parse errors:
Parser Error: Missing expected ) at column 19 in [(model.DaysOfWeek & 0x20) !== 0] in PriceComponent@129:65 ("ox">
<label>
<input type="checkbox" name="DaysOfWeek" [ERROR ->][checked]="(model.DaysOfWeek & 0x20) !== 0" (change)="model.DaysOfWeek ^= 0x20" /> Monday
"): PriceComponent@129:65

在这个绑定(bind)上:

<input type="checkbox" name="DaysOfWeek" [checked]="(model.DaysOfWeek & 0x20) !== 0" (change)="model.DaysOfWeek ^= 0x20" /> Monday

绑定(bind)表达式对我来说看起来有效,所以我很困惑为什么它会失败? DaysOfWeek 是数字类型的属性,使用星期几标志进行位编码。

最佳答案

请注意,在 Template expressions 中和 Template statements它不允许按位运算符 |和&:

模板表达式

no support for the bitwise operators | and &

模板语句

However, certain JavaScript syntax is not allowed:

  • new
  • increment and decrement operators, ++ and -- operator assignment, such as += and -=
  • the bitwise operators | and &
  • the template expression operators

关于Angular 2 模板解析错误 Missing expected ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42016928/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com