mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-24 03:55:49 +08:00
docs(guide/expression): fix duplicate key error in example
The example that demonstrates how to parse expressions can fail if you pass in the same expression twice. By using "track by $index" we can fix this. Closes #4472
This commit is contained in:
committed by
Pete Bacon Darwin
parent
3e79c9b098
commit
e7177d3159
@@ -70,7 +70,7 @@ You can try evaluating different expressions here:
|
||||
<input type='text' ng-model="expr" size="80"/>
|
||||
<button ng-click="addExp(expr)">Evaluate</button>
|
||||
<ul>
|
||||
<li ng-repeat="expr in exprs">
|
||||
<li ng-repeat="expr in exprs track by $index">
|
||||
[ <a href="" ng-click="removeExp($index)">X</a> ]
|
||||
<tt>{{expr}}</tt> => <span ng-bind="$parent.$eval(expr)"></span>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user