This repository was archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
ngRepeat 'AS' can't be placed on controllerAs variable. #8438
Milestone
Comments
caitp
added a commit
to caitp/angular.js
that referenced
this issue
Aug 1, 2014
Parse aliasAs as an expression, and assert that the expression is assignable. BREAKING CHANGE Previously, any name passed as an expression would make up a single property name, including constant values such as 1, NaN, null, undefined, or even expressions such as function calls or boolean expressions. Now, more complex expressions are possible, allowing the collection alias to be assigned as a property of an object --- however, if the expression is not determined to be assignable, it will throw. Fixes angular#8438
caitp
added a commit
to caitp/angular.js
that referenced
this issue
Aug 1, 2014
Parse aliasAs as an expression, and assert that the expression is assignable. BREAKING CHANGE Previously, any name passed as an expression would make up a single property name, including constant values such as 1, NaN, null, undefined, or even expressions such as function calls or boolean expressions. Now, more complex expressions are possible, allowing the collection alias to be assigned as a property of an object --- however, if the expression is not determined to be assignable, it will throw. Fixes angular#8438
caitp
added a commit
to caitp/angular.js
that referenced
this issue
Aug 1, 2014
Parse aliasAs as an expression, and assert that the expression is assignable. BREAKING CHANGE Previously, any name passed as an expression would make up a single property name, including constant values such as 1, NaN, null, undefined, or even expressions such as function calls or boolean expressions. Now, more complex expressions are possible, allowing the collection alias to be assigned as a property of an object --- however, if the expression is not determined to be assignable, it will throw. Fixes angular#8438
caitp
added a commit
to caitp/angular.js
that referenced
this issue
Aug 1, 2014
Parse aliasAs as an expression, and assert that the expression is assignable. BREAKING CHANGE Previously, any name passed as an expression would make up a single property name, including constant values such as 1, NaN, null, undefined, or even expressions such as function calls or boolean expressions. Now, more complex expressions are possible, allowing the collection alias to be assigned as a property of an object --- however, if the expression is not determined to be assignable, it will throw. Fixes angular#8438
caitp
added a commit
to caitp/angular.js
that referenced
this issue
Aug 20, 2014
Ensure that aliasAs expressions are valid simple identifiers. These are still assigned to $scope in the same way that they were previously, however now you won't accidentally create a property named "filtered.collection". This change additionally restricts identifiers to prevent the use of certain ECMAScript reserved words ("null", "undefined", "this" --- should probably add "super", "try", "catch" and "finally" there too), as well as certain properties used by $scope or ngRepeat, including $parent, $index, $even, $odd, $first, $middle, or $last. Fixes angular#8438
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I would like to be able to place the new ngRepeat 'AS' object on my controllerAs variable.
That way, I could either write
item in items | filter:x as results
oritem in items | filter:x as myCtrl.results
Plunk demonstrating that this isn't currently possible:
http://plnkr.co/edit/295zNjJ6wLlKtYTXL9wA?p=preview
I really like the controllerAs syntax, and like knowing for sure which scope a variable is defined on. It seems like a step backwards to not be able to do so.
The text was updated successfully, but these errors were encountered: