Bootstrap styles not loading
Hi,
I followed the steps for Global Library Installation https://github.com/angular/angular-cli#global-library-installation
-
Installed [email protected] npm install bootstrap --save
-
Then added the needed script files to to apps[0].scripts in angular-cli.json file:
"scripts": [
"../node_modules/bootstrap/dist/js/bootstrap.js"
],
and the Bootstrap CSS to the apps[0].styles array:
"styles": [
"styles.css",
"../node_modules/bootstrap/dist/css/bootstrap.css"
],
- Restarted ng serve
But the bootstrap styles are not loading
OS- Windows 7 Enterprise
angular-cli: 1.0.0-beta.21 node: 6.9.1 os: win32 x64
same issue please let me know if any one getting solution.
It happen to me today. Ubuntu, Angular 8, Bootstrap 3.
Firstly I resolved it by adding @import "~bootstrap/dist/css/bootstrap.min.css"; into styles.css but then I decided to look more into it and I compare angular.json file one from the previous projects where Bootstrap 3 was loading without issues. It is only that "Meld" (compare tool) reveled to me that in a hurry erroneously I added path to the bootstrap "styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/styles.css"
],
under the "test" section instead under "architect" section.
Once moved to ""architect" section, bootstrap started loading.
I'm inputting all 3 scripts and the bootstrap styling inside the index.html, same error.
It happen to me today. Ubuntu, Angular 8, Bootstrap 3. Firstly I resolved it by adding
@import "~bootstrap/dist/css/bootstrap.min.css";into styles.css but then I decided to look more into it and I compare angular.json file one from the previous projects where Bootstrap 3 was loading without issues. It is only that "Meld" (compare tool) reveled to me that in a hurry erroneously I added path to the bootstrap"styles": [ "node_modules/bootstrap/dist/css/bootstrap.min.css", "src/styles.css" ],under the "test" section instead under "architect" section. Once moved to ""architect" section, bootstrap started loading.
Thanks i have the same problem and it's work now
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.