angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Bootstrap styles not loading

Open Harsangeet opened this issue 9 years ago • 45 comments

Hi,

I followed the steps for Global Library Installation https://github.com/angular/angular-cli#global-library-installation

  1. Installed [email protected] npm install bootstrap --save

  2. 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"
    ],
  1. 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

Harsangeet avatar Dec 05 '16 19:12 Harsangeet

same issue please let me know if any one getting solution.

bhavinshiroya1994 avatar Jun 11 '19 07:06 bhavinshiroya1994

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.

nenadbulatovic avatar Jul 17 '19 20:07 nenadbulatovic

I'm inputting all 3 scripts and the bootstrap styling inside the index.html, same error.

Anatoly03 avatar Aug 11 '19 11:08 Anatoly03

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

MohamedAbdeljelil avatar Aug 19 '19 09:08 MohamedAbdeljelil

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.