简体   繁体   English

无法在均值堆栈中实例化模块ngMaterial

[英]Failed to instantiate module ngMaterial in mean stack

I am using mean js. 我正在使用卑鄙的js。 am a newbie in angular and mean js .I have replaced angular bootstrap with angular material. 我是Angular和Mean JS的新手。 Heres a copy of my bower.json: 这是我的bower.json的副本:

{
  "name": "meanjs",     
  "description": "Full-Stack JavaScript with MongoDB, Express, AngularJS, and Node.js",
  "dependencies": {
     "angular": "~1.3",   
     "angular-resource": "~1.3",
     "angular-animate": "~1.3",
     "angular-messages": "~1.3",
     "angular-mocks": "~1.3",
     "angular-ui-notification": "~0.2.0",
     "angular-ui-router": "~0.2.10",
     "ng-file-upload": "~12.1.0",
     "angular-material": "0.7.1",
     "owasp-password-strength-test": "~1.3.0"
  }
}

Heres the console error message: Error: [$injector:modulerr] Failed to instantiate module ngMaterial due to: Error: [$injector:nomod] Module 'ngMaterial' is not available! 这是控制台错误消息:错误:[$ injector:modulerr]由于以下原因而无法实例化模块ngMaterial:错误:[$ injector:nomod]模块'ngMaterial'不可用! 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. 如果注册模块,请确保将依赖项指定为第二个参数。

Angular config.js file: Angular config.js文件:

'use strict';

  var applicationModuleName = 'mean';

  var service = {
    applicationEnvironment: window.env,
    applicationModuleName: applicationModuleName,
    applicationModuleVendorDependencies: ['ngResource', 'ngMessages', 
    'ui.router', 'ngFileUpload', 'ui-notification','ngMaterial'],
    registerModule: registerModule
  };

My guess is you updated the bower.json but didn't run a new bower install command to pull down the library into your bower components folder. 我的猜测是您更新了bower.json,但没有运行新的bower install命令将库下拉到Bower Components文件夹中。

If you look in there so you see an angular material folder? 如果您在那里查看,那么您会看到一个有角度的材料文件夹?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM