Ghaniball Ghaniball - 4 months ago 42x
AngularJS Question

ngrepeat alias as and controller as

I get this error
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?

rob rob

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