diff --git a/src/ng/directive/ngRepeat.js b/src/ng/directive/ngRepeat.js index 69192cc4a3fb..6cac08b6fb6a 100644 --- a/src/ng/directive/ngRepeat.js +++ b/src/ng/directive/ngRepeat.js @@ -257,7 +257,7 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) { var aliasAs = match[3]; var trackByExp = match[4]; - match = lhs.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/); + match = lhs.match(/^(?:(\s*[\$\w]+)|\(\s*([\$\w]+)\s*,\s*([\$\w]+)\s*\))$/); if (!match) { throw ngRepeatMinErr('iidexp', "'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.", diff --git a/test/ng/directive/ngRepeatSpec.js b/test/ng/directive/ngRepeatSpec.js index 00e36be69a7f..f5cfdf6d3890 100644 --- a/test/ng/directive/ngRepeatSpec.js +++ b/test/ng/directive/ngRepeatSpec.js @@ -146,6 +146,16 @@ describe('ngRepeat', function() { expect(element.text()).toEqual('misko:swe|shyam:set|'); }); + it('should iterate over on object/map where (key,value) contains whitespaces', function() { + element = $compile( + '