ng bootstrap install code example

Example 1: ng-bootstrap npm install

npm install --save @ng-bootstrap/ng-bootstrap

Example 2: install angular bootstrap

# 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>

Example 3: install ng bootstrap

ng add @ng-bootstrap/ng-bootstrap

Example 4: install @ng-bootstrap/[email protected]

npm i @ng-bootstrap/ng-bootstrap

Example 5: ng bootstrap

// Installation for Angular CLI
ng add @ng-bootstrap/ng-bootstrap