Join the Stack Overflow Community
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

I am trying to install the below:

npm install bootstrap-material-design

I then added the below to my package.json

"dependencies": {
    ...
    "bootstrap-material-design": "0.5.10"
}

So in angular2 using webpack, how do I import? The docs for the package say the below and the package was installed in node_modules/bootstrap-material-design/:

<!-- Bootstrap Material Design -->
  <link rel="stylesheet" type="text/css" href="dist/css/bootstrap-material-design.css">
  <link rel="stylesheet" type="text/css" href="dist/css/ripples.min.css">

So in the head do I include via the below:

 <!-- Bootstrap Material Design -->
      <link rel="stylesheet" type="text/css" href="node_modules/bootstrap-material-design/dist/css/bootstrap-material-design.css">
      <link rel="stylesheet" type="text/css" href="node_modules/bootstrap-material-design/dist/css/ripples.min.css">

Or will angular2 already include?

share|improve this question
up vote 1 down vote accepted

It's better you include in your main module file like in app.ts file:

// Just make sure you use the relative path here
import '../../node_modules/bootstrap-material-design/dist/css/bootstrap-material-design.css'
import '../../node_modules/bootstrap-material-design/dist/css/ripples.min.css'

// your component (example code below)

@Component({
    selector: 'app',
    templateUrl: 'app.template.html'
})

And that's it. Webpack will take care of the reset.

Edit:

If you have created the app using angular-cli/ng-cli then you can also include these stylesheets to angular-cli.json

share|improve this answer
    
I assume that same logic goes with jquery too? – Tampa 18 hours ago
    
yup, correct. You can do the same with jQuery as well. – Shashank Agrawal 18 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.