无法实例化模块 ngMaterial

Failed to instantiate module ngMaterial

我无法包含 angular-material 库,以使用 angulars 日期选择器。 错误总是指:

Failed to instantiate module ngMaterial due to: Error: [$injector:nomod] http://errors.angularjs.org/1.5.0/$injector/nomod?p0=ngMa...

下一页给出消息:

Module 'ngMaterial' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

我试图交换 JavaScript- 和 HTML- 文件中依赖项的顺序。此外,我尝试了应该加载哪些模块的多种组合。一个简单的"bower update"也没有解决问题

我会感谢你的每一个想法!

script.js

var onlineApp = angular.module('onlineApp', [
    'ng',
    'ngRoute',
    'ngAnimate',
    'ngAria',
    'ngMessages',
    'ngMaterial',
    'pascalprecht.translate',
    'ui.bootstrap',
    'flow', 'flow.img', 'flow.init', 'flow.provider' ]);

bower.json

"dependencies": {
    "angular": "^1.5.0",
    "angular-bootstrap": "^1.1.2",
    "angular-route": "^1.5.0",
    "angular-material": "^1.0.5",
    "angular-translate": "^2.6.1",
    "angular-translate-loader-static-files": "^2.8.0",

    "jquery": "^1.10.2",
    "bootstrap": "^3.1.1",
    "bootstrapvalidator": "^0.5.0",
    "flow.js": "^2.9.0",
    "momentjs": "^2.5.1",
    "ng-file-upload": "^5.0.9",
    "ng-flow": "^2.6.1"
},

index.html

    <!-- build:js js/vendor.js -->
    <script src="bower_components/jquery/dist/jquery.min.js"></script>
    <script src="bower_components/angular/angular.min.js"></script>
    <script src="bower_components/angular-animate/angular-animate.min.js"></script>
    <script src="bower_components/angular-route/angular-route.min.js"></script>
    <script src="bower_components/angular-material/angular-material.min.js"></script>
    <script src="bower_components/angular-messages/angular-messages.min.js"></script>
    <script src="bower_components/angular-aria/angular-aria.min.js"></script>
    <script src="bower_components/momentjs/min/moment-with-locales.min.js"></script>
    <script src="bower_components/ng-file-upload/ng-file-upload-all.min.js"></script>
    <script src="bower_components/angular-translate/angular-translate.min.js"></script>
    <script src="bower_components/ng-flow/dist/ng-flow.min.js"></script>
    <script src="bower_components/flow.js/dist/flow.min.js"></script>
    <script src="bower_components/angular-translate-loader-static-files/angular-translate-loader-static-files.min.js"></script>
    <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
    <script src="bower_components/bootstrapvalidator/dist/js/bootstrapValidator.min.js"></script>
    <script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
    <!-- endbuild -->
    <!-- build:js js/site.js -->
    <script src="js/onlinereg.js"></script

问题解决了。 我还必须使用依赖项扩展 "Gruntfile.js"。 现在它就像一个魅力。

如何使用依赖项

扩展Gruntfile.js