DeathNote DeathNote - 1 year ago 106
AngularJS Question

ngTable not working, simple example - copied from official website

Website I followed :

I was searching for table directives to quicken the whole work and I landed to

github page and their specific web url.

I followed the process listed on their main page, but I don't know why this isn't working.

js fiddle link : Click Here


<table ng-table="vm.tableParams" class="table" show-filter="true">
<tr ng-repeat="user in $data">
<td title="'Name'" filter="{ name: 'text'}" sortable="'name'">
<td title="'Age'" filter="{ age: 'number'}" sortable="'age'">


var self = this;
var data = [{name: "Moroni", age: 50},{name: "Moroni", age: 50},{name: "Moroni", age: 50},{name: "Moroni", age: 50},{name: "Moroni", age: 50},{name: "Moroni", age: 50}];
self.tableParams = new NgTableParams({}, { dataset: data});

Answer Source

I changed some things in your example. Here's the basic stuff in the controller:

$ = [{
  name: "Test1",
  age: 50
}, {
  name: "Test2",
  age: 51
}, {
  name: "Test3",
  age: 52
}, {
  name: "Test4",
  age: 53
}, {
  name: "Test5",
  age: 54
}, {
  name: "Test6",
  age: 55

$scope.tableParams = new NgTableParams({}, {
  dataset: $

Hopefully this will give you a point in the right direction of solving your problem.

Working demo:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download