当前位置 : 主页 > 网页制作 > Bootstarp >

如何制作你的角度加载bootstrap主题css

来源:互联网 收集:自由互联 发布时间:2021-06-12
你的角度安装bootstrap文件都很好. index.html文件目前看起来像这样: !-- Place favicon.ico and apple-touch-icon.png in the root directory --!-- build:css(.) styles/vendor.css --!-- bower:css --link rel="stylesheet" href="
你的角度安装bootstrap文件都很好. index.html文件目前看起来像这样:

<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<!-- build:css(.) styles/vendor.css -->
<!-- bower:css -->
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css" />
<!-- endbower -->
<!-- endbuild -->
<!-- build:css(.tmp) styles/main.css -->
<link rel="stylesheet" href="styles/main.css">
<!-- endbuild -->

这不包括bootstrap.theme.css文件.

建议添加此方法的方法是什么?我手动进去并添加吗?

正确的方法是覆盖你的bower.json文件来加载bootstrap依赖项,然后运行grunt wiredep

bower.json看起来像这样:

{
  "name": "frontend",
  "version": "0.0.0",
  "dependencies": {
    "angular": "^1.3.0",
    "json3": "^3.3.0",
    "es5-shim": "^4.0.0",
    "bootstrap": "^3.2.0",
    "angular-cookies": "^1.3.0",
    "angular-route": "^1.3.0",
    "angular-local-storage": "~0.1.5",
    "raty": "~2.7.0",
    "kineticjs": "~5.1.0"
  },
  "devDependencies": {
    "angular-mocks": "~1.3.0",
    "angular-scenario": "~1.3.0"
  },
  "appPath": "app",
  "overrides": {
    "bootstrap": {
      "main": [
        "less/bootstrap.less",
        "dist/css/bootstrap.css",
        "dist/css/bootstrap-theme.css",
        "dist/js/bootstrap.js",
        "dist/fonts/glyphicons-halflings-regular.eot",
        "dist/fonts/glyphicons-halflings-regular.svg",
        "dist/fonts/glyphicons-halflings-regular.ttf",
        "dist/fonts/glyphicons-halflings-regular.woff"
      ]        
    }
  }
}

资料来源:https://github.com/yeoman/generator-angular/issues/965#issuecomment-68548259

网友评论