bower install

时间:2017-08-28 12:33:21

标签: angularjs gulp bower

我已添加了我的角度项目的bower依赖项,但这些依赖项在bower.json文件中更新,但在index.html中没有。因为我在gulp发送后出现Uncaught ReferenceError: angular is not defined错误。 我尝试了bower install / bower install --save-dev

bower.json

{
  "name": "test",
  "version": "0.0.0",
  "dependencies": {
    "angular": "^1.4.0",
    "angular-animate": "^1.4.0",
    "angular-cookies": "^1.4.0",
    "angular-resource": "^1.4.0",
    "angular-route": "^1.4.0",
    "angular-sanitize": "^1.4.0",
    "angular-touch": "^1.4.0"
  },
  "devDependencies": {
    "angular-mocks": "^1.4.0",
    "jquery": "^3.2.1"
  },
  "appPath": "app",
  "moduleName": "testApp"
}

的index.html

<!-- build:js(.) scripts/vendor.js -->
    <!-- bower:js -->
    <!-- endbower -->
    <!-- endbuild -->

        <!-- build:js({.tmp,app}) scripts/scripts.js -->
        <script src="scripts/app.js"></script>
        <script src="scripts/controllers/main.js"></script>
        <!-- endbuild -->

1 个答案:

答案 0 :(得分:0)

优先使用您的文件,因为在.js中,优先级始终是重要的,