beewest
beewest

Reputation: 4846

angular-cli: how to add external libraries (jquery, bootstrap)

Currently I have to do:

In index.html

<script src="assets/jquery/jquery.min.js"></script>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<link href="assets/bootstrap/css/bootstrap.min.css" rel="stylesheet">

Any better way?

Upvotes: 1

Views: 934

Answers (1)

Chrillewoodz
Chrillewoodz

Reputation: 28328

Read this and you will understand:

https://github.com/angular/angular-cli#3rd-party-library-installation

Basically you just have to add it to the scripts property in the angular-cli.json file (apps[0]).

"scripts": [
  "../node_modules/jquery/dist/jquery.js",
  "../node_modules/tether/dist/js/tether.js",
  "../node_modules/bootstrap/dist/js/bootstrap.js"
]

Upvotes: 1

Related Questions