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

n3-charts and injectors #429

Closed
gwenaellarmet opened this issue Feb 10, 2016 · 8 comments
Closed

n3-charts and injectors #429

gwenaellarmet opened this issue Feb 10, 2016 · 8 comments

Comments

@gwenaellarmet
Copy link

I'm trying to add n3-charts to my curent angular project and i'm having trouble getting it injected by gulp or grunt.
So far I tried :

  1. install n3-charts with npm install as recommended
  2. install n3-charts with bower to get the src and make a build of it
  3. tried again 1 and 2 on a new clean project generated by : https://github.com/Swiip/generator-gulp-angular

I put the module as a dependency
angular.module('xxxx', [ 'n3-line-chart' ]);

I always get the same error :
ncaught Error: [$injector:modulerr] Failed to instantiate module xxxx due to:
Error: [$injector:modulerr] Failed to instantiate module n3-line-chart due to:
Error: [$injector:nomod] Module 'n3-line-chart' is not available! 

Any idea how to get n3-chart to work on my project ?

@lorem--ipsum
Copy link
Member

Have you added the JavaScript file to your HTML file ?

@gwenaellarmet
Copy link
Author

Yes indeed, but I wish I could avoid putting the link in my html file and let my injector do the work.
Could you make a bower package alongside the npm package ? I think It would resolve my issue in no time.

@lorem--ipsum
Copy link
Member

Well even with a bower package you'd still have to include the script file.

@gwenaellarmet
Copy link
Author

I have included the script file but it still doesn't work.
You can try with the generator I linked you should get the same result as I did

@UCKFA
Copy link

UCKFA commented Feb 24, 2016

I have the same problem. It doesn't load the files in the 'node_modules' directory after installing with npm, and if I do it manually, the error remains the same, but the files are loaded.

EDIT: I used the Yeoman generator and n3-chart v1 was working properly.

@UCKFA
Copy link

UCKFA commented Feb 26, 2016

I would like to share with you my solution. I moved the n3-charts folder to the bower_components folder. The problem is that the files are not loaded from the node_modules folder.

@lorem--ipsum
Copy link
Member

If you install something with npm, you shouldn't be looking for it in the bower_components folders...

@chaosmail
Copy link
Contributor

Hi @UCKFA
hope you found a temporary solution for your problem. I will close this now and you can follow the status of bower support here #438.
Best,
Christoph

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

4 participants