getPage() always give undefined as page.
See original GitHub issueAngular 2 version: rc 5
ng2-pagination version: latest
Description of issue: in console i always get NaN
filters:Object = {};
p: number = 1;
total: number = 30;
...
...
...
getPage(page:any) {
console.log('page', page);
}
<md-list-item *ngFor="let item of users | async | paginate: { id: 'server', itemsPerPage: 1, currentPage: p, totalItems: total }">
....
....
....
<pagination-controls (pageChange)="getPage($event)" id="server"></pagination-controls>
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Undefined index page if get page - Stack Overflow
page =something pages only with a index page... I'm trying to define index page, when u go to www.sometging.com to open specific index...
Read more >Notice: Undefined variable: pages in menu.php on 7 - PHPHelp
Hi, I have setup a basic Model View Presenter and have implemented my website theme into it. Menu links are being populated via...
Read more >webContents | Electron
Returns WebContents | undefined - A WebContents instance with the given ID, or undefined if there is no WebContents associated with the given...
Read more >7 Tips to Handle undefined in JavaScript - Dmitri Pavlutin
A detailed article about 'undefined' keyword in JavaScript. 7 tips on how to handle correctly 'undefined' and increase code durability.
Read more >PageManager (Atlassian Confluence 5.9.5 API)
Retrieve a collection of pages with the given content IDs. List<Page>, getPages(Space space, boolean currentOnly). List ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@michaelbromley i was able to fix the error, i was using immutable List which paginator didnt understand as data. So all i needed to do was data.toArray() without using async pipe and it worked.
@kodeine I’m afraid I don’t have the time to try to reproduce the issue and then debug it. The fact is, the code you posted originally looks to me like it should work. It is almost identical to the working demo.
Therefore the issue must lie elsewhere, in code which you did not post. The only way for me (or anyone else) to figure out what that code might be, is to spend time attempting to reproduce the issue. This may take a long time, depending on the origin of the bug. The person best positioned to do this work is you, since you have both the best knowledge of your code base, and also the greatest motivation to spend time doing so.
This is a long-winded way of saying that this issue is not really actionable for me unless you provide a minimal demo which reproduces the issue. Try this Plunker demo as a basis.