I am new to Angular and was not sure if this is the recommended syntax in Angular. In AngularJS, we can do one-time binding in this way:
<p>{{::myVar}}</p>
In Angular, I know we can do this.
<p [innerText]="myVar"></p>
My first question is, is this the only way to achieve {{::}}
in Angular?
What if I have this situation in AngularJS:
<p>{{::myVar}} is a variable</p>
I have tried something like this
<p [innerText]="myVar + 'is a variable'"></p>
It works but again is this the recommended syntax?
{{myVar}}
` ? – eko May 14 '17 at 08:50{{myVar}}
` is not 2 way binding. It's one way binding. – Ploppy May 14 '17 at 09:07