0

Firstly, I am new to AngularJS. I was wondering what are the best practices around sharing common javascript code across multiple AngularJS projects?

What do the experienced AngularJS ninjas do out there?

I have heard of bower.

2
  • depends upon what multiple projects mean? if you have more than one projects sharing same js than publish at one place and use it or It would be easy to just copy paste that same js in other projects...so, you can optimize or change it.×An error occurred during comment submission×An error occurred during comment submission×An error occurred during comment submission Commented May 6, 2015 at 11:02
  • 1
    Copy pasting JS is not a good way to maintain code in the long term imho. By multiple projects I mean two different projects sharing some functionality. Commented May 6, 2015 at 13:26

1 Answer 1

1

By creating independent modules that you will then inject wherever you need to use those features. (you will have to include the .js files too)

Sign up to request clarification or add additional context in comments.

2 Comments

Okay. So create modules and publish them to a private bower repository?
Yeah, for instance. Kind of similar to creating plugins or libraries.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.