我知道这是一个常见的问题,但我有一个项目,我正在移植到Angular,并且我需要在应用程序内加载的任何模块(即ngStorage)都没有加载。我在控制台日志中继续收到此错误:
angular.js:68 Uncaught Error: [$injector:modulerr] Failed to instantiate module ICSPortalLoginAuth due to:
Error: [$injector:modulerr] Failed to instantiate module ngStorage due to:
Error: [$injector:nomod] Module 'ngStorage' is not available! 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.
http://errors.angularjs.org/1.5.0/$injector/nomod?p0=ngStorage
at http://devel1.local.com/js/ng/angular.js:68:12
at http://devel1.local.com/js/ng/angular.js:2015:17
at ensure (http://devel1.local.com/js/ng/angular.js:1939:38)
at module (http://devel1.local.com/js/ng/angular.js:2013:14)
at http://devel1.local.com/js/ng/angular.js:4503:22
at forEach (http://devel1.local.com/js/ng/angular.js:321:20)
at loadModules (http://devel1.local.com/js/ng/angular.js:4487:5)
at http://devel1.local.com/js/ng/angular.js:4504:40
at forEach (http://devel1.local.com/js/ng/angular.js:321:20)
at loadModules (http://devel1.local.com/js/ng/angular.js:4487:5)
http://errors.angularjs.org/1.5.0/$injector/modulerr?p0=ngStorage&p1=Error%…ules%20(http%3A%2F%2Fdevel1.local.com%2Fjs%2Fng%2Fangular.js%3A4487%3A5)
at http://devel1.local.com/js/ng/angular.js:68:12
at http://devel1.local.com/js/ng/angular.js:4526:15
at forEach (http://devel1.local.com/js/ng/angular.js:321:20)
at loadModules (http://devel1.local.com/js/ng/angular.js:4487:5)
at http://devel1.local.com/js/ng/angular.js:4504:40
at forEach (http://devel1.local.com/js/ng/angular.js:321:20)
at loadModules (http://devel1.local.com/js/ng/angular.js:4487:5)
at createInjector (http://devel1.local.com/js/ng/angular.js:4409:19)
at doBootstrap (http://devel1.local.com/js/ng/angular.js:1691:20)
at bootstrap (http://devel1.local.com/js/ng/angular.js:1712:12)
http://errors.angularjs.org/1.5.0/$injector/modulerr?p0=ICSPortalLoginAuth&…rap%20(http%3A%2F%2Fdevel1.local.com%2Fjs%2Fng%2Fangular.js%3A1712%3A12)
ngStorage加载在AngularJS或我的Angular模型之前的标题中:
<script type='text/javascript' src='/js/ngstorage/ngStorage.min.js'></script>
<script type='text/javascript' src='js/ng/angular.js'></script>
<script src='js/ngres/LoginAuth.js'></script>
并且在App声明
中声明了ngStoragevar app = angular.module("Devel1", ['ngStorage']);
我并不清楚明白还有什么可能导致这种情况。还有其他可能导致干扰的JavaScript依赖项,即jQuery和jspdf。这些会干扰模块加载器吗?
我很难过这里的原因是什么。我删除了模块,代码可以正常工作(无论代码是什么)。
答案 0 :(得分:0)
请在加载ngStorage脚本之前加载角度脚本并查看.... 这可能很好