Skip to content

Instantly share code, notes, and snippets.

@embarq
Last active January 26, 2018 15:59
Show Gist options
  • Select an option

  • Save embarq/0a00874c943f2e8eeca84b5b1a6e15a7 to your computer and use it in GitHub Desktop.

Select an option

Save embarq/0a00874c943f2e8eeca84b5b1a6e15a7 to your computer and use it in GitHub Desktop.

Bootstrap setup in Angular CLI project

  1. Install bootstrap dependencies:
> npm install bootstrap jquery popper.js
  1. Add bootstrap styles, scripts and bootstrap dependencies(popper.js and jquery for ^4.0.0 version) to the .angular-cli.json. Assets paths should be relative to an app root(src by default)
{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "project": {
    "name": "blog-cards"
  },
  "apps": [
    {
      "root": "src",
      "outDir": "dist",
      // ...
      "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"
      ]
      // ...
    }
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment