Ng-table: Examples seem to list incorrect dependency name

Created on 3 Apr 2014  ·  12Comments  ·  Source: esvit/ng-table

I'm new to Angular, so forgive me if this is totally wrong, but the examples show something similar to this:

var app = angular.module('main', ['ngTable']).controller('DemoCtrl', function($scope, $filter, ngTableParams) {
...

And that throws this error: Error: [$injector:unpr] Unknown provider: ngTableProvider <- ngTable

Changing 'ngTable' to 'ngTableParams' worked. Is this what the examples should say, or am I missing something?

question

Most helpful comment

I looked at some demos on Codepen, and it seams, that the name has changed:
It is now NgTableParams with a big N at the beginning.

All 12 comments

All examples work fine. ngTable is the name of module. The string angular.module('main', ['ngTable']) means the main module depends on ngTable module. ngTableParams is the name of service, so the changing 'ngTable' to 'ngTableParams' is wrong.

I have the exactly the same issue. I understand that you are saying the example is correct, but if so, why is the error Unknown provider: ngTableProvider <- ngTable being thrown?

Well, changing the code to:

 ['$scope', 'ngTableParams', function ($scope, ngTableParams) {

worked for me.

In what class? Thank you!

-Michael

On Aug 25, 2014, at 10:32 AM, Jirka Helmich [email protected] wrote:

Well, changing the code to:

['$scope', 'ngTableParams', function ($scope, ngTableParams) {
worked for me.


Reply to this email directly or view it on GitHub.

Those are my dependencies for a controller.

I had the exact same issue and the same remedy worked. I trust the maintainer that this is not a bug, but I am extremely curious as to the explanation.

This continues to be an issue for me as well.

Am curious as to status & resolution, if any.
I am not new to Angular & using AngularJS 1.2.24 and the most recent nuGet package of ngTable.

No matter how I inject of reference ngTable, I keep getting same Error: [$injector:unpr] Unknown provider: ngTableProvider <- ngTable

Thank you for your time.

I had the exact same issue and the same remedy worked.

Thank the lord I finally found this post..I should have paid more attention to the 'understanding controllers' section of the AJ dev guide, particularly setting up the initial state. This solved all my problems. Here's my full code for others

app.controller('DemoCtrl', ['$scope', '$filter', '$sce', 'ngTableParams', function ($scope, $filter, $sce, ngTableParams){

I looked at some demos on Codepen, and it seams, that the name has changed:
It is now NgTableParams with a big N at the beginning.

Thanks @herrminni changing to NgTableParams to a capital "N" worked for me. My code had been working since sometime last year and I had not changed anything, which lead to me to suspecting that one of the libraries that I was using had changed. Thank you for validating my initial thoughts and giving me a solution to my issue

Proof that it works http://kronusproductions.com/songs_angular/#

In order to use ngTable module you need to follow the steps in http://ng-table.com

Mind that NgTableParams injection is with capital N

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ramesh-git picture ramesh-git  ·  21Comments

gavJackson picture gavJackson  ·  3Comments

nammu picture nammu  ·  8Comments

alaa-eddine picture alaa-eddine  ·  12Comments

KlavsKlavsen picture KlavsKlavsen  ·  3Comments