Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

angularjs fails to parse "( aaa, bbb) in xxx" (extra space before "aaa") in ngRepeat value #6827

Closed
davidmichaelkarr opened this issue Mar 25, 2014 · 0 comments

Comments

@davidmichaelkarr
Copy link

I noticed that an ngRepeat value of "( aaa, bbb) in xxx" or "(aaa, bbb ) in xxx" fails to parse.

It results in an error like the following:
Error: [ngRepeat:iidexp] 'item' in 'item in collection' should be an identifier or > '(key, value)' expression, but got '( aaa, bbb)'.

I've been told that the regexp that validates this string is the following:

^(?:([$\w]+)|(([$\w]+)\s_,\s_([$\w]+)))$

In the interest of completeness and "least surprise", this regexp (along with any corresponding required code) should be changed to include "\s*" before the key and after the value.

@lefos987 lefos987 assigned lefos987 and unassigned lefos987 Mar 25, 2014
SekibOmazic added a commit to SekibOmazic/angular.js that referenced this issue Mar 25, 2014
Whitespaces allowed in (key,value) expression of ngRepeat.

e.g. (  aaa  ,   bbb  ) will be accepted by parser

closes angular#6827
@btford btford added this to the Backlog milestone Mar 27, 2014
@btford btford removed the gh: issue label Aug 20, 2014
SekibOmazic added a commit to SekibOmazic/angular.js that referenced this issue Nov 28, 2014
Whitespaces allowed in (key,value) expression of ngRepeat.

e.g. (  aaa  ,   bbb  ) will be accepted by parser

closes angular#6827
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants