如何实现ng-bootstrap 4表排序,分页和过滤 [英] How to implement ng-bootstrap 4 table sorting, pagination and filtering

查看:193
本文介绍了如何实现ng-bootstrap 4表排序,分页和过滤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查看 ng-bootstrap的官方文档 ,在他们的一些官方示例中,该代码无法正常工作.我特别是在谈论此示例.这使我很难理解代码的工作方式,从而可以按自己的方式实现它.

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.

我见过这个问题,但答案是对于angularjs来说已经过时了.

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

所以现在我的问题是:

  1. 我如何实现ng-bootstrap 4表排序,分页和过滤,如下所示
  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.

推荐答案

我终于有了解决方案.我去他们的github 来检查问题并

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.

这是工作代码 带有排序,分页和过滤功能的ng-bootstrap 4表.

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

我基本上组织了代码,并添加了原始stackblitz代码中省略的一些内容.

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

存在的问题之一是该指令未在AppModule的声明数组中声明.

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

这篇关于如何实现ng-bootstrap 4表排序,分页和过滤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆