Reputation: 49
I'm working on an angular project, and I'm using bootstrap CSS and js for styling. Once I built that project the bootstrap is not working properly. If I use the CDN link in the project then the bootstrap styling working inbuilt project. How shall I overcome the problem?? I can't use the CDN link for this project, Is there any alternative solution for this??
Upvotes: 1
Views: 2234
Reputation: 1487
if you want pure bootstrap, as Shilpa mentioned install pure bootstrap. This will install a latest variation of bootstrap 4
npm install --save bootstrap
Now go to your angular.json
file and add what Ashvin mentioned
....
....
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/styles.scss"
],
....
....
Example : https://stackblitz.com/edit/angular-ivy-dykx6n
Upvotes: 0
Reputation: 41
You can install Bootstrap module
npm install --save bootstrap
and include bootstrap css file in your style css
@import "~bootstrap/dist/css/bootstrap.min.css";
Upvotes: 1
Reputation: 96
I am using bootstrap for my website and did not have any issues. Did you use Angular CLI to add bootstrap to your project? I used the Angular CLI for mine and used the following code to add it to my project:
ng add @ng-bootstrap/ng-bootstrap
My angular.json looks like that:
I hope it helps!
Upvotes: 0