Angular / Steps / Step 2: Include Bootstrap
Include Bootstrap
-
Step
Bootstrap
1. Install bootstrapnpm install bootstrap bootstrap folders will be installed in node_modules folder
bootstrap package version will be added to the file package.json
2. add the css and js file to angular.json1. open angular.json
2. add css file to the parameter 'styles'
3. add js files to the parameter 'scripts'
{ "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "version": 1, "newProjectRoot": "projects", "projects": { "angular-bootstrap-examples": { "projectType": "application", "schematics": {}, "root": "", "sourceRoot": "src", "prefix": "app", "architect": { "build": { "builder": "@angular-devkit/build-angular:browser", "options": { "outputPath": "dist/angular-bootstrap-examples", "index": "src/index.html", "main": "src/main.ts", "polyfills": "src/polyfills.ts", "tsConfig": "tsconfig.app.json", "aot": true, "assets": [ "src/favicon.ico", "src/assets" ], "styles": [ "./node_modules/bootstrap/dist/css/bootstrap.css", "src/styles.css" ], "scripts": [ "./node_modules/jquery/dist/jquery.js", "./node_modules/bootstrap/dist/js/bootstrap.js" ] }, 2. Other libraries
Tosternpm install ngx-toastr --save add in angular.json
"styles": [ "./node_modules/bootstrap/dist/css/bootstrap.css", "src/styles.css" "./node_modules/ngx-toastr/toastr.css", ],