i'm trying to learn how to work with angular firmly and i'm having trouble understanding some of the syntax used in the guides and examples on the official website. when defining a button form control i saw this template:
<div><button type="{{::to.type}}" class="btn btn-{{::to.btnType}}" ng-click="onClick($event)">{{to.text}}</button></div>
my question is: what is the meaning of "::" before the "to.type" and "to.btnType"? how is it being used? how is that different from defining it like this:
<a ng-class="{'btn-primary': to.isPrimary, active: to.isActive}" class="btn, btn-default"/>
It is a one-time binding expression, it stops the proliferation of watchers which can often cause performance issues.
Here is some useful reading: http://blog.thoughtram.io/angularjs/2014/10/14/exploring-angular-1.3-one-time-bindings.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With