1

Currently I have to do:

  • install local libs npm install bootstrap and npm install jquery
  • create a folder src\assets
  • copy all files in node_modules\bootstrap and node_modules\jquery

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?

1
  • It literally says in the documentation how to do this. Commented Sep 20, 2016 at 5:01

1 Answer 1

1

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"
]
Sign up to request clarification or add additional context in comments.

Comments

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.