kamilkp / angular-vs-repeat

Virtual Scroll for AngularJS ngRepeat directive
http://kamilkp.github.io/angular-vs-repeat/
MIT License
818 stars 228 forks source link

ng-repeat expression as alias_expression #86

Open offtopic opened 9 years ago

offtopic commented 9 years ago

I tried to use vs-repeat in an existing project - it performs really good!

Unfortunately we can not use the alias syntax as mentioned in the ng-repeat documentation:

https://docs.angularjs.org/api/ng/directive/ngRepeat

variable in expression as alias_expression – You can also provide an optional alias expression which will then store the intermediate results of the repeater after the filters have been applied. Typically this is used to render a special message when a filter is active on the repeater, but the filtered result set is empty.

`

  1. {{ item.a }}
  2. </ol>`

    Error: [$parse:syntax] Syntax Error: Token 'as' is an unexpected token at column 7 of the expression [array as] starting at [as].

    Is it possible to extend the directive for suporting the alias expression

    Please see also my Plunker: http://plnkr.co/edit/zeK61fcw4yLSJIu8fGfm?p=preview

    Thx Tom

offtopic commented 9 years ago

I made a short test to support alias expression: https://github.com/offtopic/angular-vs-repeat/commit/74dcb95ab44fdaa79bf97cb1963359702b93c740

magro commented 8 years ago

+1, we'd also need alias support.

tcdevs commented 8 years ago

Guys, check my early issue #6 for the solution.