404 when load bootstrap-italia

Viewed 21

I need to load a botstrap-italia CSS. I install bootstrap-italia and I when I run the server I do this:

ng build --watch --base-href /home/

I have just installed bootstrap-italia, it is in my node module, so I import css in this way: (in my index.html):

I do:

<link href="../node_module/bootstrap-italia/dist/css/bootstrap-italia.min.css" rel="stylesheet">

It creates this link:

http://localhost:8080/node_modules/bootstrap-italia/dist/css/bootstrap-italia.min.css

in node module there is the path but it gives me 404. Anyone can help me?

1 Answers

The css needs to be added using the angular.json file to be available to be used into the project.

Go to angular.json file inside your project then add this link in the array of styles that you can find in it.

  "styles": [
    "node_module/bootstrap-italia/dist/css/bootstrap-italia.min.css"
]

Then it should work

Related