Error: $injector:modulerr Module Error

Failed to instantiate module app due to://实例化失败
Error: [$injector:modulerr] http://errors.angularjs.org/1.6.6/$injector/modulerr?p0=n...)
    at http://localhost:56500/Scripts/angular.min.js:7:76
    at http://localhost:56500/Scripts/angular.min.js:43:70
    at p (http://localhost:56500/Scripts/angular.min.js:8:7)
    at g (http://localhost:56500/Scripts/angular.min.js:42:138)
    at http://localhost:56500/Scripts/angular.min.js:42:322
    at p (http://localhost:56500/Scripts/angular.min.js:8:7)
    at g (http://localhost:56500/Scripts/angular.min.js:42:138)
    at hb (http://localhost:56500/Scripts/angular.min.js:46:250)
    at c (http://localhost:56500/Scripts/angular.min.js:22:19)
    at Uc (http://localhost:56500/Scripts/angular.min.js:22:332

Description

This error occurs when a module fails to load due to some exception. The error message above should provide additional context.

A common reason why the module fails to load is that you've forgotten to include the file with the defined module or that the file couldn't be loaded.

当模块由于某些异常而无法加载时,会发生此错误。 上面的错误信息应该提供额外的上下文。

模块无法加载的常见原因是您忘记将文件包含在定义的模块中,或者该文件无法加载。

Using ngRoute

In AngularJS 1.2.0 and later, ngRoute has been moved to its own module. If you are getting this error after upgrading to 1.2.x or later, be sure that you've installed ngRoute.

在AngularJS 1.2.0及更高版本中,ngRoute已被移至其自己的模块。 如果在升级到1.2.x或更高版本后收到此错误,请确保已经安装了ngRoute。(若已安装,请确保正确引用)

Monkey-patching AngularJS's ng module

This error can also occur if you have tried to add your own components to the ng module. This has never been supported and from 1.3.0it will actually trigger this error. For instance the following code could trigger this error.

如果您尝试将自己的组件添加到ng模块,也可能会发生此错误。 这从未被支持,从1.3.0it将实际触发此错误。 例如,以下代码可能会触发此错误。

angular.module('ng').filter('tel', function (){});

Instead create your own module and add it as a dependency to your application's top-level module. See #9692 and #7709 for more information

你可以创建自己的模块,并将其作为依赖关系添加到应用程序的顶级模块中。 有关详细信息,请参阅#9692和#7709

原文地址:https://www.cnblogs.com/JackeyLove/p/7680167.html