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

Cyrillic loop variable name in ngRepeat not supported by ngParseExt module #15926

Closed
1 of 3 tasks
epliskin opened this issue Apr 20, 2017 · 3 comments
Closed
1 of 3 tasks

Comments

@epliskin
Copy link

epliskin commented Apr 20, 2017

I'm submitting a ...

  • bug report
  • feature request
  • other (Please do not submit support requests here (see above))

Current behavior:

Using ngParseExt module (https://docs.angularjs.org/api/ngParseExt) for Unicode support in HTML,
it is still impossible to introduce a loop variable with cyrillic name into "ngRepeat" directive,
while cyrillic expressions are OK.
Expected / new behavior:

Expecting cyrillic loop variable names to be valid under ngParseExt.

Minimal reproduction of the problem with instructions:

Working HTML: div ng-repeat="f in поля"

Not working HTML: div ng-repeat="п in поля"

Angular version: 1.6.1

Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

Chrome, Edge

Anything else:

Error: [ngRepeat:iidexp] 'item' in 'item in collection' should be an identifier or '(key, value)' expression, but got 'п'.
http://errors.angularjs.org/1.6.1/ngRepeat/iidexp?p0=%D0%BF
at ngRepeatCompile (http://eugene:8080/rnst/2017-04-19/js/lib/angular-1.6.1/angular.js:30701:9)
at applyDirectivesToNode (http://eugene:8080/rnst/2017-04-19/js/lib/angular-1.6.1/angular.js:9444:13)
at compileNodes (http://eugene:8080/rnst/2017-04-19/js/lib/angular-1.6.1/angular.js:8803:9)
at compileNodes (http://eugene:8080/rnst/2017-04-19/js/lib/angular-1.6.1/angular.js:8812:9)
at compile (http://eugene:8080/rnst/2017-04-19/js/lib/angular-1.6.1/angular.js:8684:7)
at lazyCompilation (http://eugene:8080/rnst/2017-04-19/js/lib/angular-1.6.1/angular.js:9131:11)
at boundTranscludeFn (http://eugene:8080/rnst/2017-04-19/js/lib/angular-1.6.1/angular.js:8924:9)
at controllersBoundTransclude (http://eugene:8080/rnst/2017-04-19/js/lib/angular-1.6.1/angular.js:9691:13)
at ngIfWatchAction (http://eugene:8080/rnst/2017-04-19/js/lib/angular-1.6.1/angular.js:27259:15)
at Scope.prototype.$digest (http://eugene:8080/rnst/2017-04-19/js/lib/angular-1.6.1/angular.js:17814:23) ngRepeat: п in поля
angular.js (14328,11)

@Narretz
Copy link
Contributor

Narretz commented Apr 20, 2017

Hi,
ngRepeat is using a special micro syntax for this part of the expression, that uses a regex and not the parser, see

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}\'.',
lhs);
}

While this is confusing, I don't think this is in the scope of parseExt - to make it work would definitely require non-trivial effort, as non-unicode matching would have to be available only with parseExt, either via regex or a different parser.

Since this is low frequency, I don't think we will work on this in the future, but PRs are welcome.

@Narretz Narretz modified the milestones: Backlog, Ice Box Apr 20, 2017
@Narretz Narretz changed the title Cyrillic loop variable name still not supported by ngParseExt module v.1.6.1. Cyrillic loop variable name in ngRepeat not supported by ngParseExt module Apr 20, 2017
@gkalpak
Copy link
Member

gkalpak commented Apr 20, 2017

BTW, similar issues may arise with parts of the ngOptions micro-syntax. I agree that fixing it is probably not worth the effort :/

@epliskin epliskin mentioned this issue May 2, 2017
3 tasks
@epliskin
Copy link
Author

epliskin commented May 2, 2017

Opened a pull request #15954.

Narretz added a commit to Narretz/angular.js that referenced this issue Jan 14, 2019
Narretz added a commit to Narretz/angular.js that referenced this issue Jan 14, 2019
Narretz added a commit to Narretz/angular.js that referenced this issue Jan 21, 2019
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