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

Unknown provider: cgBusyDefaults #109

Open
simonemazzoni opened this issue Jan 18, 2017 · 4 comments
Open

Unknown provider: cgBusyDefaults #109

simonemazzoni opened this issue Jan 18, 2017 · 4 comments

Comments

@simonemazzoni
Copy link

Hello @cgross,
tried right now to update the module using this library.
Previously I had to use https://github.com/tiberiuzuld/angular-busy because this project looked unmaintained.

Except the fact that install it from npm is a real mess (due to several versions with different names!), I finally managed to install the correct version but it gives me this error when I try to set the config provider.

Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to: Error: [$injector:unpr] Unknown provider: cgBusyDefaults

I really don't understand why. I checked the source code and the provider extension actually exists, but the error exists too.
Notice I am using Angularjs 1.5.9

Let me know asap.
Thanks

Simone

@geo242
Copy link

geo242 commented Jan 24, 2017

@simonemazzoni This error seems like it could be that the library is either not being loaded, or not being loaded before your module is instantiated. Have you checked both of those things?

@simonemazzoni
Copy link
Author

@geo242 thanks for the answer, but I don't think it is a load problem.

I found out that the correct way to define defaults config is this:
angular.module('your_app').value('cgBusyDefaults',{ message:'Loading Stuff', backdrop: false, templateUrl: 'my_custom_template.html', delay: 300, minDuration: 700, wrapperClass: 'my-class my-class2' });

So it isn't exposed a provider as in other angular modules. That's my error.

Anyway I think that implement and export a provider would be preferable, at least in my opinion.

@geo242
Copy link

geo242 commented Jan 24, 2017

@simonemazzoni Sorry, I missed the fact that you were looking for a config provider. You can either use the method you describe, or inject the cgBusyDefaults into a run block and manipulate it there.

Setting the defaults in a provider sounds like a good candidate for a PR. :)

@simonemazzoni
Copy link
Author

simonemazzoni commented Jan 25, 2017

@geo242 Yes, I can think about it as soon I find some time. ;)

Please leave this open so that me or someone knows it has to be done.

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

No branches or pull requests

2 participants