2

I am getting the following exception:

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

on this binding:

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

The binding expressions look valid to me, so I am puzzled as to why it fails? DaysOfWeek is a property of type number that is bit encoded with day of week flags.

0

1 Answer 1

7

Note that in Template expressions and Template statements it's not allow the bitwise operators | and &:

Template expressions

no support for the bitwise operators | and &

Template statements

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
Sign up to request clarification or add additional context in comments.

1 Comment

maybe, you could extract to a method in js/ts file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.