@@ -218,7 +218,8 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {
218
218
return function ( $scope , $element , $attr ) {
219
219
var expression = $attr . ngRepeat ;
220
220
var match = expression . match ( / ^ \s * ( .+ ) \s + i n \s + ( .* ?) \s * ( \s + t r a c k \s + b y \s + ( .+ ) \s * ) ? $ / ) ,
221
- trackByExp , trackByExpGetter , trackByIdFn , trackByIdArrayFn , trackByIdObjFn , lhs , rhs , valueIdentifier , keyIdentifier ,
221
+ trackByExp , trackByExpGetter , trackByIdExpFn , trackByIdArrayFn , trackByIdObjFn ,
222
+ lhs , rhs , valueIdentifier , keyIdentifier ,
222
223
hashFnLocals = { $id : hashKey } ;
223
224
224
225
if ( ! match ) {
@@ -232,7 +233,7 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {
232
233
233
234
if ( trackByExp ) {
234
235
trackByExpGetter = $parse ( trackByExp ) ;
235
- trackByIdFn = function ( key , value , index ) {
236
+ trackByIdExpFn = function ( key , value , index ) {
236
237
// assign key, value, and $index to the locals so that they can be used in hash functions
237
238
if ( keyIdentifier ) hashFnLocals [ keyIdentifier ] = key ;
238
239
hashFnLocals [ valueIdentifier ] = value ;
@@ -275,16 +276,17 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {
275
276
childScope ,
276
277
key , value , // key/value of iteration
277
278
trackById ,
279
+ trackByIdFn ,
278
280
collectionKeys ,
279
281
block , // last object information {scope, element, id}
280
282
nextBlockOrder = [ ] ;
281
283
282
284
283
285
if ( isArrayLike ( collection ) ) {
284
286
collectionKeys = collection ;
285
- trackByIdFn = trackByIdFn || trackByIdArrayFn ;
287
+ trackByIdFn = trackByIdArrayFn || trackByIdExpFn ;
286
288
} else {
287
- trackByIdFn = trackByIdFn || trackByIdObjFn ;
289
+ trackByIdFn = trackByIdObjFn || trackByIdExpFn ;
288
290
// if object, extract keys, sort them and use to determine order of iteration over obj props
289
291
collectionKeys = [ ] ;
290
292
for ( key in collection ) {
0 commit comments