Unable to add bootstrap in angular

Issue

Hi I am using using Angular 5 and I am trying to import bootstrap in my code but unable to do so. I have installed bootstrap using:

npm install --save bootstrap

I have also add the css file to the .angular-cli.json as:

"styles": ["../node_modules/bootstrap/dist/css/bootstrap.min.css",
    "../node_modules/bootstrap/dist/css/bootstrap.css",
    "styles.css"
],

But when I inspect my code in google chrome what I get is this,

<!doctype html>
<html lang="en">
   <head>
      <meta charset="utf-8">
      <title>MyFirstApp</title>
      <base href="/">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <link rel="icon" type="image/x-icon" href="favicon.ico">
   </head>
   <body>
      <app-root></app-root>
      <script type="text/javascript" src="inline.bundle.js"></script><script type="text/javascript" src="polyfills.bundle.js"></script><script type="text/javascript" src="styles.bundle.js"></script><script type="text/javascript" src="vendor.bundle.js"></script><script type="text/javascript" src="main.bundle.js"></script>
   </body>
</html>

There is no styles for bootstrap in the header section. Please help me. I am stuck

Solution

“./../node_modules/bootstrap/dist/css/bootstrap.css”,
./../node_modules/bootstrap/dist/css/bootstrap.min.css”,

use same like this

Answered By – Digvijay ManeDeshmukh

Answer Checked By – Mildred Charles (AngularFixing Admin)

Leave a Reply

Your email address will not be published.