|
80 | 80 | * * `variable in expression` – where variable is the user defined loop variable and `expression`
|
81 | 81 | * is a scope expression giving the collection to enumerate.
|
82 | 82 | *
|
83 |
| - * For example: `track in cd.tracks`. |
| 83 | + * For example: `album in artist.albums`. |
84 | 84 | *
|
85 | 85 | * * `(key, value) in expression` – where `key` and `value` can be any user defined identifiers,
|
86 | 86 | * and `expression` is the scope expression giving the collection to enumerate.
|
|
91 | 91 | * which can be used to associate the objects in the collection with the DOM elements. If no tracking function
|
92 | 92 | * is specified the ng-repeat associates elements by identity in the collection. It is an error to have
|
93 | 93 | * more than one tracking function to resolve to the same key. (This would mean that two distinct objects are
|
94 |
| - * mapped to the same DOM element, which is not possible.) |
| 94 | + * mapped to the same DOM element, which is not possible.) Filters should be applied to the expression, |
| 95 | + * before specifying a tracking expression. |
95 | 96 | *
|
96 | 97 | * For example: `item in items` is equivalent to `item in items track by $id(item)'. This implies that the DOM elements
|
97 | 98 | * will be associated by item identity in the array.
|
|
101 | 102 | * with the corresponding item in the array by identity. Moving the same object in array would move the DOM
|
102 | 103 | * element in the same way ian the DOM.
|
103 | 104 | *
|
104 |
| - * For example: `item in items track by item.id` Is a typical pattern when the items come from the database. In this |
| 105 | + * For example: `item in items track by item.id` is a typical pattern when the items come from the database. In this |
105 | 106 | * case the object identity does not matter. Two objects are considered equivalent as long as their `id`
|
106 | 107 | * property is same.
|
107 | 108 | *
|
| 109 | + * For example: `item in items | filter:searchText track by item.id` is a pattern that might be used to apply a filter |
| 110 | + * to items in conjunction with a tracking expression. |
| 111 | + * |
108 | 112 | * @example
|
109 | 113 | * This example initializes the scope to a list of names and
|
110 | 114 | * then uses `ngRepeat` to display every person:
|
|
0 commit comments