You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
As of 1.2.6, the parser accepts multiline string in ng-repeat. However, the same does not exist for ng-options in elements. The current regex for matching ng-options is:
var NG_OPTIONS_REGEXP = /^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+(.*?)(?:\s+track\s+by\s+(.*?))?$/
Following the same pattern to fix #5000, the new regex could be:
var NG_OPTIONS_REGEXP = /^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\r\n\s\S]*?)(?:\s+track\s+by\s+(.*?))?$/
In the above, [\r\n\s\S] is added after in\s+(, replacing the . there.
However, I have not tested the above change.
There may be other elements that also support iteration and don't allow multiline strings that I missed too.
The text was updated successfully, but these errors were encountered:
This patch allows the ng-options value of a <select> element to span
multiple lines, which would previously throw an error when used with filters.
Closesangular#5602
This patch allows the ng-options value of a <select> element to span
multiple lines, which would previously throw an error when used with filters.
Closesangular#5602
jamesdaily
pushed a commit
to jamesdaily/angular.js
that referenced
this issue
Jan 27, 2014
This patch allows the ng-options value of a <select> element to span
multiple lines, which would previously throw an error when used with filters.
Closesangular#5602
jamesdaily
pushed a commit
to jamesdaily/angular.js
that referenced
this issue
Jan 27, 2014
As of 1.2.6, the parser accepts multiline string in ng-repeat. However, the same does not exist for ng-options in elements. The current regex for matching ng-options is: var NG_OPTIONS_REGEXP = /^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+(.*?)(?:\s+track\s+by\s+(.*?))?$/ Following the same pattern to fix #5000, the new regex could be: var NG_OPTIONS_REGEXP = /^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\r\n\s\S]*?)(?:\s+track\s+by\s+(.*?))?$/ In the above, [\r\n\s\S] is added after in\s+(, replacing the . there. However, I have not tested the above change. There may be other elements that also support iteration and don't allow multiline strings that I missed too.
The text was updated successfully, but these errors were encountered: