angularjs - Grunt Wiredep 没有在 Yeoman Angular 教程中注入(inject) Bootstrap css 文件

标签 angularjs twitter-bootstrap gruntjs yeoman bower

我正在阅读有关使用 Yeoman (http://yeoman.io/codelab.html) 设置 AngularJS 应用程序的教程,并且 Bootstrap 的 CSS 文件未包含在 index.html 文件中。因此,当我运行 grunt serve 时,该页面缺少所有 Bootstrap 样式,这与教程图像中显示的不同。

Bootstrap javascript 文件包含在 index.html 文件中。

这是正常行为还是我打算手动包含它?我本来希望运行 Grunt Wiredep 将 Bootstrap css 文件包含在 <!-- bower:css --><!-- endbower --> 之间。 index.html 文件中的占位符?

最佳答案

将 bootstrap 的覆盖代码添加到您的 bower.json 文件中(不要编辑 bower_components 中的任何内容)

"dependencies": {
...
},
"overrides": {
  "bootstrap": {
    "main": [
      "dist/js/bootstrap.js",
      "dist/css/bootstrap.css",
      "less/bootstrap.less"
        ]
    }
}

http://blog.getbootstrap.com/2015/06/15/bootstrap-3-3-5-released/

关于angularjs - Grunt Wiredep 没有在 Yeoman Angular 教程中注入(inject) Bootstrap css 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31015812/

相关文章:

javascript - 未找到 Angular JS 服务(无法实例化模块)

angularjs - 如何防止 Kendo MultiSelect 在网格模板中编辑后丢失值?

twitter-bootstrap - Bootstrap 4.1 中的 bd-highlight 是什么?

javascript - 使用 grunt 在静态服务器上运行 Qunit 测试时遇到问题

javascript - 使用 Grunt Bake 观看多个文件而无需一次全部编译

angularjs - 动态图像 ng-src 不会更改为缩小图像名称

javascript - 无法读取输入| Angularfire + Firebase

angularjs - 对 Ionic 应用程序进行网络实时预览

javascript - 使用 Bootstrap 的响应式 3 列布局

html - 视差效果在某些页面上不起作用