You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're using ngIf to hide the Pagination component if there's only one page of results and found the component isn't subscribed to DefaultTableStatePagination's events.
So if Pagination is instantiated (or deleted and re-instantiated) after Table is already up and running then it never registers for the tableState.pagination events.
We're using ngIf to hide the Pagination component if there's only one page of results and found the component isn't subscribed to DefaultTableStatePagination's events.
This line uses table.tableStateChange events to register listener for tableState.pagination.changed:
https://github.com/hoveytech/ng2-power-table/blob/565ffa9caa1d0e349cca1d2075a665fc2cc8b8d8/src/Pagination/Pagination.component.ts#L51
but those events are only fired on init or reference change:
https://github.com/hoveytech/ng2-power-table/blob/0c870a451b97530147bbad31acf898089c83bdc3/src/Table/Table.directive.ts#L62
https://github.com/hoveytech/ng2-power-table/blob/0c870a451b97530147bbad31acf898089c83bdc3/src/Table/Table.directive.ts#L70
https://github.com/hoveytech/ng2-power-table/blob/0c870a451b97530147bbad31acf898089c83bdc3/src/Table/Table.directive.ts#L85
So if Pagination is instantiated (or deleted and re-instantiated) after Table is already up and running then it never registers for the tableState.pagination events.
Binding to the component's 'hidden' attribute is a work-around but has other issues that make ngIf the preferred method for conditionally displaying a part of the DOM:
http://www.talkingdotnet.com/dont-use-hidden-attribute-angularjs-2/
The text was updated successfully, but these errors were encountered: