Pooja-G Pooja-G - 1 year ago 99
AngularJS Question

NgTable dynamic sorting depend on column

I am using ngTable to show data in table with pagination.
But Now I want to add sorting on each column.

Does any on have an idea about it?

pD7 pD7
Answer Source

have a look at ngTable documentation - here and example here

 function demoController(NgTableParams, simpleList) {
    this.tableParams = new NgTableParams({
      // initial sort order
      sorting: { name: "asc" } 
    }, {
      dataset: simpleList