xxxxxxxxxx
// Installation for Angular CLI
ng add @ng-bootstrap/ng-bootstrap
xxxxxxxxxx
# From project directory:
npm install --save bootstrap
npm install --save jquery
# Now edit `angular.json`
# Position: `projects -> architect -> build -> options`
# To `styles`, add "node_modules/bootstrap/dist/css/bootstrap.css"
# To `scripts`,
# add "node_modules/jquery/dist/jquery.js"
# and also "node_modules/bootstrap/dist/js/bootstrap.js"
# Test with
# <<div class="alert alert-primary" role="alert"> Bootstrap alert</div>
xxxxxxxxxx
//1. Install ngx-bootstrap and bootstrap:
npm install ngx-bootstrap bootstrap --save
//2. Open src/app/app.module.ts and add:
import { AlertModule } from 'ngx-bootstrap';
@NgModule({
imports: [AlertModule.forRoot(), ],
})
//3. Open angular-cli.json
"styles": [
"styles.css",
"../node_modules/bootstrap/dist/css/bootstrap.min.css"
],
xxxxxxxxxx
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"styles.scss"
]