I start with my first AngularJS application. I try with angular-gulp-browserify-starter and work fine. But now I'm trying to add ngTable , but gulp build says:
'NgTableParams' is not defined.
I am trying to follow these steps: http://ng-table.com/ .
1- Add a ng table with a gazebo
bower install ng-table
2- Add module to app.js
var angular = require('angular'); angular.module('myApp', ['ngTable']); // this is the new line module.exports = angular.module('myApp', [ require('./common/common.js').name, require('./modules').name ]) .config(require('./appConfig')) .constant('version', require('../package.json').version) .run(require('./common/common-init.js'));
3- And this is my controller
'use strict'; function TableCtrl($scope) { $scope.testVar = 'This my test for ngtable'; } TableCtrl.$inject = ['$scope']; module.exports = TableCtrl;
Where and how did I put it?
var self = this; var data = [{name: "Moroni", age: 50} ]; self.tableParams = new NgTableParams({}, { dataset: data});
I have HTML as stated in the sitle ng-table instructions.
Thanks!
source share