Pooja-G Pooja-G - 5 months ago 54
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

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