ng-table icon indicating copy to clipboard operation
ng-table copied to clipboard

Support controllerAs syntax to paginate data?

Open MaicolBen opened this issue 12 years ago • 4 comments

Hi,

To paginate data, ng-table can't work with controllerAs syntax.

Demo

Thanks

MaicolBen avatar Nov 27 '14 13:11 MaicolBen

You are iterating over incorrect property demo.data. ng-table creates own scope with paginated properties. Change "user in demo.data" to "user in $data" and it will work.

maxaon avatar Dec 09 '14 11:12 maxaon

Ok, I understand thar ng-table create own scope, but i'm new in Angular, what is "**$**data"? why not "data"? (and setted in the controller scope).

MaicolBen avatar Dec 09 '14 13:12 MaicolBen

data - is created by you, and not held by ng-table. Ng-table creates own scope and add "spatial" scope properties like $data, $columns etc. Ng-table operates only with this properties, not yours. $data contains paginated and filtered objects, which was got from getData method.

maxaon avatar Dec 09 '14 13:12 maxaon

Thanks!

MaicolBen avatar Dec 09 '14 13:12 MaicolBen