I get this error https://code.angularjs.org/1.3.16/docs/error/ngRepeat/badident when I try to use ngRepeat alias as syntax with controller as syntax:
<li ng-repeat="item in vm.items | filter:vm.searchString as vm.collections">{{item}}</li>
It's not allowed or I do something wrong?
if you need to store the result on the vm variable you can do it like this
<li ng-repeat="item in vm.collections = (vm.items | filter:vm.searchString)">{{item}}</li>
If not then Donal's solution will work
Should be a simple identifier (such that you could declare it with var {name})
<li ng-repeat="item in vm.items | filter:searchString as collections">{{item}}</li>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With