如何创建只读ng-repeat?

Jos*_*eph 4 angularjs

初始渲染非常慢ng-repeat.如何创建只读版本ng-repeat,以便当您迭代的数组发生更改时,呈现的HTML不会更改

Jos*_*eph 12

双冒号使Angular中的东西只读.使用以下语法:

<ul>
    <li ng-repeat="item in ::items">{{item.name}}</li>
</ul>
Run Code Online (Sandbox Code Playgroud)