【问题标题】:Failed to instantiate module ngMaterial in mean stack无法在平均堆栈中实例化模块 ngMaterial
【发布时间】:2023-03-22 20:53:02
【问题描述】:

我正在使用平均 js。我是角度和平均js的新手。我已经用角度材料替换了角度引导程序。 这是我的 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"
  }
}

以下是控制台错误消息: 错误:[$injector:modulerr] 无法实例化模块 ngMaterial 由于: 错误:[$injector:nomod] 模块“ngMaterial”不可用!您要么拼错了模块名称,要么忘记加载它。如果注册模块,请确保将依赖项指定为第二个参数。

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
  };

【问题讨论】:

标签: javascript angularjs node.js meanjs


【解决方案1】:

我的猜测是您更新了 bower.json,但没有运行新的 bower install 命令将库下拉到您的 bower 组件文件夹中。

如果你在里面看到一个有角度的材质文件夹?

【讨论】:

  • 不,我已经在 bower_components 内部安装了 .angular 材质文件夹。我的代码放在 github 中。请看这里github.com/sreyas/mean
猜你喜欢
  • 2016-05-27
  • 2015-01-20
  • 1970-01-01
  • 2015-04-19
  • 2016-08-29
  • 1970-01-01
  • 1970-01-01
  • 2018-12-25
  • 2021-03-31
相关资源
最近更新 更多