Closed imevro closed 10 years ago
I'm not sure how ngTable works but I presume that you would like to do something similar to this:
angular.module('remark').classy.controller
name: 'ListCtrl'
inject: ['$scope', 'ngTableParams']
init: ->
data = [{name: "Moroni", age: 50},
{name: "Tiancum", age: 43},
{name: "Jacob", age: 27},
{name: "Nephi", age: 29},
{name: "Enos", age: 34},
{name: "Tiancum", age: 43},
{name: "Jacob", age: 27},
{name: "Nephi", age: 29},
{name: "Enos", age: 34},
{name: "Tiancum", age: 43},
{name: "Jacob", age: 27},
{name: "Nephi", age: 29},
{name: "Enos", age: 34},
{name: "Tiancum", age: 43},
{name: "Jacob", age: 27},
{name: "Nephi", age: 29},
{name: "Enos", age: 34}];
@$scope.customersTable = new @ngTableParams(
page: 1
count: 10
,
total: data.length
getData: ($defer, params) ->
$defer.resolve _data.slice((params.page() - 1) * params.count(), params.page() * params.count())
return
)
Hello! Thanks for your module.
When I try inject ngTableParams (factory in ngTable), angular says ReferenceError
Uncaught ReferenceError: ngTableParams is not defined
My controller:
CoffeeScript; AngularJS 1.2.16, ngTable 0.3.1