javascript - ngTable with requirejs - ngTableParams object is not a function -
got bit of problem when using ngtable require js. when try set attributes of ngtableparams object not function though copied code http://bazalt-cms.com/ng-table/example/3
my controller looks this.
define(['./module', 'ngtable'], function (controllers) { 'use strict'; controllers.controller('mycontroller', ['$scope', '$rootscope', 'ngtableparams', function ($scope, $rootscope ngtableparams) { $scope.tableparams = new ngtableparams({ page: 1, // show first page count: 10, // count per page sorting: { name: 'asc' // initial sorting } }, { total: data.length, // length of data getdata: function($defer, params) { // use build-in angular filter var ordereddata = params.sorting() ? $filter('orderby')(data, params.orderby()) : data; $defer.resolve(ordereddata.slice((params.page() - 1) * params.count(), params.page() * params.count())); } }]); });
if got ideas how procees appreciate it.
it works me when changed
controllers.controller('mycontroller', ['$scope', '$rootscope', 'ngtableparams', function ($scope, $rootscope ngtableparams)]);
to following
controllers.controller('mycontroller', function ($scope, $rootscope ngtableparams)
Comments
Post a Comment