Pooja-G Pooja-G - 14 days ago 6
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

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
    });
  }
Comments