Bind attribute only once (like bindonce)

129 views Asked by At

On a component is it possible to bind in the style like bindonce? Please provide an example.

1

There are 1 answers

1
dimson d On BEST ANSWER

since angular have v1.3 it used following syntax for bindonce

<div ng-repeat="item in ctrl.results">
    <div>{{ ::item.name }} - {{ ::item.description }}</div>
</div>
<div ng-if="::vm.user.loggedIn"></div>
for class
ng-class="::{ loggedIn: vm.user.loggedIn }"