1

So I have been reading the official documentation "template syntax of Angular2" angular.io here in the sub heading of property binding "Avoid side effects" i see these lines that i dont understand

We can’t assign a value to anything in a property binding expression nor use the increment and decrement operators. our expression might invoke a property or method that has side effects. Angular has no way of knowing that or stopping us.

blackHawk
  • 4,966
  • 8
  • 47
  • 94

1 Answers1

0

Assigning 'yyy' to xxx in a property binding expression is not supported

<div [someProp]="xxx = 'yyy'"> <!-- doesn't work -->

Using increment and decrement operators is not supported

<div [someProp]="xxx++"> <!-- doesn't work -->
Günter Zöchbauer
  • 490,478
  • 163
  • 1,733
  • 1,404