michaelbromley / angularUtils

A place where I will collect useful re-usable Angular components that I make
MIT License
2k stars 861 forks source link

It doesnot work with as keyword in angular js - ng-repeat="friend in friends | filter:q as results" #448

Closed yugansh20 closed 4 years ago

yugansh20 commented 7 years ago

Hi, thanks for contributing!

This project is maintained in my spare time, so in order to help me address your issue as quickly as possible, please provide as much of the following information as you can:

-- Michael

======= (Delete the above. Fill in the rest as applicable)

Description of issue: When we use

The value of results always remain undefined. Though results gets assigned in the angular version 1.3.17+. **Steps to reproduce**: Anywhere in the dir-paginate attribute add "as results" or any variable name and check the value of that variable by printing in console, it will be undefined. **Expected result**: The value of results should be the current filtered items/rows that are shown on the page. **Actual result**: Undefined. **Demo**: (for dirPagination, fork and modify this Plunk: http://plnkr.co/edit/b37IdFFJUokaeSummETX?p=preview) Any relevant code: ``` ``` You can check this here - https://docs.angularjs.org/api/ng/directive/ngRepeat. Check the last example.
schester44 commented 7 years ago

I'm having trouble with using the 'as' keyword as well. I get the following error

pagination directive: the 'itemsPerPage' filter must be set. <template-list-item class="table-list-item" dir-paginate="template in $ctrl.items | filter: $ctrl.searchString as filteredTemplates | itemsPerPage: 2" item="template">
schester44 commented 7 years ago

ahh disregard.. this is a duplicate.

found my answer here: https://github.com/michaelbromley/angularUtils/issues/328