Some may say that using a CDN is the way to go, but for Webstorm's intellesense alone, I prefer to install Bootstrap as a dependency. There are other packages out there that you can use such as ngx-bootstrap, but this is the vanilla Bootstrap (including JavaScript) method.

NOTICE

If you're looking to install the lastest version of Boostrap (beta) use this post.

Run in your terminal:

npm install bootstrap@4.0.0-beta --save

And you need to install it's dependencies (jquery) and (popper)

npm install jquery@3.0.0 --save

npm install popper.js@^1.11.0 --save

If you want to use SASS rather than CSS use:

npm install bootstrap@4.0.0-beta --save --style=sass

Or if you want to only install for development purposes, just append --save-dev.

npm install bootstrap@4.0.0-beta --save-dev, and make sure you do the same with jquery and popper.

Open up your angular-cli.json file and add the style and scripts.


    "styles": [
        "../node_modules/bootstrap/dist/css/bootstrap.min.css",
        "styles.css"
      ],
      "scripts": [
        "../node_modules/jquery/dist/jquery.slim.min.js",
        "../node_modules/popper.js/dist/umd/popper.min.js",
        "../node_modules/bootstrap/dist/js/bootstrap.min.js"
      ],

If you're using SASS use this config:


    "styles": [
        "styles.scss"
      ],
      "scripts": [
        "../node_modules/jquery/dist/jquery.slim.min.js",
        "../node_modules/popper.js/dist/umd/popper.min.js",
        "../node_modules/bootstrap/dist/js/bootstrap.min.js"
      ],

And with SASS you need to make one last step. Place the line below in your styles.scss file (imports bootstrap)

@import "../node_modules/bootstrap/scss/bootstrap"

Restart your server and you should be ready to code!

Extra Sass file configuration:

Create directory in: src/styles

Create files and place in that directory: _variables.scss, _custom.scss

Change: .angular-cli.json


          "styles": [
        "styles/styles.sass"
      ],

Import files into: styles.scss


@import "../../node_modules/bootstrap/scss/bootstrap"
@import "variables"
@import "custom"