http:// localhost:4200 / node_modules / bootstrap / dist / css / bootstrap.min.css angular2

时间:2017-03-27 07:07:41

标签: angular

我在index.html文件中添加了bootstrap依赖项。此索引文件位于src文件夹中。和节点模块在它上面。文件夹结构如下。

Library
  node_modules
  src
    index.html

现在我的目标是index.html中的node_modules。我的代码如下。

   <link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.min.css">
   <script src="../node_modules/jquery/dist/jquery.min.js"></script>

还尝试使用./,然后从node_modules开始。这是什么问题。

1 个答案:

答案 0 :(得分:2)

  • Please check whether the file is available in under node_modules
    • import that CSS inside styles.css file, that will be compiled automatically

Hope you are using angular-cli package

@import '~bootstrap/dist/css/bootstrap.min.css';