How to implement ng-bootstrap 4 table sorting, pagination and filtering

走远了吗. 提交于 2020-08-01 05:22:27

问题


I am going through the official documentation of ng-bootstrap, in some of their official examples, the code is not working. In particular I am talking about this and this examples, when you open them in stackblitz. This makes it hard for me to understand how the code works so that I can implement it my way.

I have seen this question but the answer is outdated as it is for angularjs.

So now my questions is:

  1. How can I implement ng-bootstrap 4 table sorting, pagination and filtering as shown here? What is the issue with the given code why is it not working?

A working example would be great as it would help me see and understand how the code works. Thank you.


回答1:


I finally have a solution. I went to their github to check the issues and someone confirmed that indeed the stackblitz code has an issue but gave the source code and a work-around.

Here is the working code of an ng-bootstrap 4 table with sorting, pagination and filtering.

I basically organised the code and added a few things that were omitted in the original stackblitz code.

Among the issues that were there, was that the directive wasn't declared in the declarations' array in AppModule.



来源:https://stackoverflow.com/questions/54700298/how-to-implement-ng-bootstrap-4-table-sorting-pagination-and-filtering

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!