Error: [$injector:unpr] Unknown provider: ngTableParamsProvider <- ngTableParams
Another cause of this error is renaming of ngTableParams
into NgTableParams
in version 1.0.0. So, if you are using version 1.0.0, the code should look like this:
customModule.factory("customTable", function (NgTableParams) { function setupNgTable() { var parameters = { count: 10 }; var settings = { getData: function (params) { } }; return new NgTableParams(parameters, settings); }}
You need
- Add reference to
<script src="....ng-table.js"></script>
(more likely in in your index.html file) Inject ngTable to your angular module ie:
var myApp = angular.module('myApp',['ngTable']);
in controller
myApp.controller('someCtrl', function($scope, ngTableParams) {....});
It looks like ngTableParams
has been now changed to NgTableParams
, starting with "N" instead of 'n'.
So, now the code will look something like this...
First, Add ng-table.js
or ng-table.min.js
link in your HTML code.
Then in your app.js or in the script part do like this...
var app = angular.module('XXX', ['ngTable']);app.controller('XXXXX', function($scope, NgTableParams){//-Inside wherever your using ngTableParams change it to NgTableParams................});
Hope this will help.