简体   繁体   English

绑定属性仅一次(如bindonce)

[英]Bind attribute only once (like bindonce)

On a component is it possible to bind in the style like bindonce ? 组件上是否可以像bindonce这样的样式进行绑定? Please provide an example. 请提供一个例子。

since angular have v1.3 it used following syntax for bindonce 由于angular有v1.3,因此它对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 }"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM