How to use AngularDart ng-repeat over a list of simple values possibly with duplicates
问题 The AngularDart ng-repeat directive seems to require unique values; e.g., the following <li ng-repeat="x in ['Alice', 'Bob', 'Alice']">...</li> results in [NgErr50] ngRepeat error! Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Assuming that the list of strings is obtained from some external source and that uniqueness of values is not guaranteed, how can the [NgErr50] be avoided? 回答1: This works: <li ng-repeat="x in ['Alice', 'Bob', 'Alice'] track