AngularJS has a new feature since the version 1.3.0-beta.10: the "lazy one-time binding".
Simple expressions can be prefixed with ::
, telling angular to stop watching after the expression was first evaluated. The common example given is something like:
<div>{{::user.name}}</div>
Is there a similar syntax for expressions like the following ones?
<div ng-if="user.isSomething && user.isSomethingElse"></div>
<div ng-class="{classNameFoo: user.isSomething}"></div>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…