HelloWorld
HelloWorld

Reputation: 4882

How to install javascript libraries in angularjs not being a npm package/bower component

How do you install javascript libraries where no bower/npm package exists?

Just add the myscript.js to the html?

In the angularjs generated project structure I do not even see a folder for such files because scripts is for my MVC files...

So where and how to add it correctly?

Upvotes: 1

Views: 1865

Answers (2)

Thomas Guillory
Thomas Guillory

Reputation: 5729

Basically, just include it before your project files.

<script src="path/to/your/lib.js" type="text/javascript" />
<script src="angular.js" type="text/javascript" />
<script src="project/controllers.js" type="text/javascript" />
...

You also could use something like RequireJS or Browserify.

Upvotes: 0

chr1s1202
chr1s1202

Reputation: 467

Add it in an extra sub folder like scripts/vendor and add the path to the html.

Upvotes: 1

Related Questions