无法实例化模块ngMaterial,尽管它在bower.json

时间:2017-11-06 09:53:11

标签: javascript angularjs node.js heroku mean-stack

我在MEAN项目中遇到了问题。我们的环境托管在heroku上。我们在项目中开始使用ngMaterial,这在本地工作正常,当我们在Heroku上的临时环境中运行它时。但是一旦我推送到我们的生产服务器,我们就会收到错误消息:无法实例化模块ngMaterial

我们的bower.json:

{
  "name": "",
  "version": "0.4.0",
  "description": "",
  "dependencies": {
    "bootstrap": "~3",
    "angular": "~1.4",
    "angular-resource": "~1.4",
    "angular-animate": "~1.4",
    "angular-aria": "~1.4",
    "angular-mocks": "~1.4",
    "angular-ui-utils": "bower",
    "angular-ui-router": "0.2.18",
    "angular-file-upload": "1.1.5",
    "bootstrap-ui": "^1.3.2",
    "ng-tasty": "^0.6.1",
    "angular-bootstrap": "^1.3.2",
    "highcharts-ng": "^0.0.11",
    "highcharts": "^4.2.5",
    "angular-bootstrap-colorpicker": "^3.0.25",
    "angular-audio": "^1.7.2",
    "underscore": "^1.8.3",
    "angularjs-dropdown-multiselect": "^1.5.2",
    "ng-file-upload": "^12.2.12",
    "angular-moment": "^1.0.1",
    "moment": "2.8.1",
    "font-awesome": "fontawesome#^4.7.0",
    "angular-material": "^1.1.5"
  },
  "resolutions": {
    "angular": "~1.4",
    "moment": "2.8.1"
  }
}

我们的模块/ core / client / app.config.js:

'use strict';

// Init the application configuration module for AngularJS application
var ApplicationConfiguration = (function() {
    // Init module configuration options
    var applicationModuleName = 'mean';
    var applicationModuleVendorDependencies = [
        'ngResource',
        'ngAnimate',
        'ui.router',
        'ui.bootstrap',
        'ui.utils',
        'ngFileUpload',
        'ngTasty',
        'ngAnimate',
        'ngAria',
        'ngMaterial',
        'highcharts-ng',
        'colorpicker.module',
        'ngAudio',
        'angularjs-dropdown-multiselect',
        'angularMoment',
    ];
    // Add a new vertical module
    var registerModule = function(moduleName, dependencies) {
        // Create angular module
        angular.module(moduleName, dependencies || []);
        // Add the module to the AngularJS configuration file
        angular.module(applicationModuleName).requires.push(moduleName);
    };

    return {
        applicationModuleName: applicationModuleName,
        applicationModuleVendorDependencies: applicationModuleVendorDependencies,
        registerModule: registerModule
    };
})();

由于我通过凉亭安装了角度材料依赖,因此我没有使用index.html中的CDN链接。这可能导致任何问题吗?

0 个答案:

没有答案