diff --git a/src/uiSelectMultipleDirective.js b/src/uiSelectMultipleDirective.js index 472555172..498c2ead1 100644 --- a/src/uiSelectMultipleDirective.js +++ b/src/uiSelectMultipleDirective.js @@ -105,10 +105,13 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec locals[$select.parserResult.itemName] = list[p]; result = $select.parserResult.modelMapper(scope, locals); if($select.parserResult.trackByExp){ - var matches = /\.(.+)/.exec($select.parserResult.trackByExp); - if(matches.length>0 && result[matches[1]] == value[matches[1]]){ - resultMultiple.unshift(list[p]); - return true; + var propsItemNameMatches = /(\w*)\./.exec($select.parserResult.trackByExp); + var matches = /\.([^\s]+)/.exec($select.parserResult.trackByExp); + if(propsItemNameMatches.length > 0 && propsItemNameMatches[1] == $select.parserResult.itemName){ + if(matches.length>0 && result[matches[1]] == value[matches[1]]){ + resultMultiple.unshift(list[p]); + return true; + } } } if (angular.equals(result,value)){