0

我不能包含 angular-material 库,以使用 angulars datepicker。错误总是指:

由于以下原因无法实例化模块 ngMaterial:错误:[$injector:nomod] http : //errors.angularjs.org/1.5.0/$injector/nomod?p0=ngMa...

下一页给出了信息:

模块“ngMaterial”不可用!您要么拼错了模块名称,要么忘记加载它。如果注册模块,请确保将依赖项指定为第二个参数。

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

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

脚本.js

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

鲍尔.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"
},

索引.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
4

2 回答 2

0

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

于 2016-02-16T14:25:01.683 回答
0

如何使用依赖项扩展 Gruntfile.js

于 2017-12-21T06:17:02.817 回答