Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples seem to list incorrect dependency name #266

Closed
ivyfae opened this issue Apr 3, 2014 · 12 comments
Closed

Examples seem to list incorrect dependency name #266

ivyfae opened this issue Apr 3, 2014 · 12 comments
Labels

Comments

@ivyfae
Copy link

ivyfae commented Apr 3, 2014

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?

@esvit
Copy link
Owner

esvit commented Apr 12, 2014

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.

@esvit esvit added the question label Apr 12, 2014
@mcolburn
Copy link

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?

@jirihelmich
Copy link

Well, changing the code to:

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

worked for me.

@mcolburn
Copy link

In what class? Thank you!

-Michael

On Aug 25, 2014, at 10:32 AM, Jirka Helmich notifications@github.com wrote:

Well, changing the code to:

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


Reply to this email directly or view it on GitHub.

@jirihelmich
Copy link

Those are my dependencies for a controller.

@CaptainLexington
Copy link

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.

@iv301vi
Copy link

iv301vi commented Mar 20, 2015

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.

@filip-java
Copy link

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

@kunjanray
Copy link

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){

@herrminni
Copy link

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.

@kronus
Copy link

kronus commented Jun 19, 2016

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/#

@bonfimtm
Copy link

bonfimtm commented Sep 27, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests