Improve this Doc

Error: ngRepeat:badident
Invalid identifier expression

alias '{0}' is invalid --- must be a valid JS identifier which is not a reserved name.

Description

Occurs when an invalid identifier is specified in an ngRepeat expression.

The ngRepeat directive's alias as syntax is used to assign an alias for the processed collection in scope.

If the expression is not a simple identifier (such that you could declare it with var {name}, or if the expression is a reserved name, this error is thrown.

Reserved names include:

Invalid expressions might look like this:

<li ng-repeat="item in items | filter:searchString as this">{{item}}</li>
<li ng-repeat="item in items | filter:searchString as some.objects["property"]">{{item}}</li>
<li ng-repeat="item in items | filter:searchString as resultOfSomeMethod()">{{item}}</li>
<li ng-repeat="item in items | filter:searchString as foo=6">{{item}}</li>

Valid expressions might look like this:

<li ng-repeat="item in items | filter:searchString as collections">{{item}}</li>
<li ng-repeat="item in items | filter:searchString as filteredCollection">{{item}}</li>