Angularjs grunt构建后,即使使用ng注释,角度模块也不可用
我用的是约曼角发电机。我创建了Angular模块,并尝试将其加载到应用程序中。Grunt使用ng annotate,供应商脚本(模块所在位置)在应用程序脚本之前加载,所以我不知道问题出在哪里 这是commpressed index.htmlAngularjs grunt构建后,即使使用ng注释,角度模块也不可用,angularjs,gruntjs,yeoman,ng-annotate,Angularjs,Gruntjs,Yeoman,Ng Annotate,我用的是约曼角发电机。我创建了Angular模块,并尝试将其加载到应用程序中。Grunt使用ng annotate,供应商脚本(模块所在位置)在应用程序脚本之前加载,所以我不知道问题出在哪里 这是commpressed index.html <!doctype html> <html> <head> <meta charset="utf-8"> <title></title> <meta name="descripti
<!doctype html> <html> <head> <meta charset="utf-8"> <title></title> <meta name="description" content=""> <meta name="viewport" content="width=device-width"> <!-- Place favicon.ico and apple-touch-icon.png in the root directory --> <link rel="stylesheet" href="styles/vendor.20fdc362.css"> <link rel="stylesheet" href="styles/main.16c86e60.css"> </head> <body ng-app="strauiApp"> <!--[if lte IE 8]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]--> <div ui-view></div> <script src="scripts/vendor.c9b57eb5.js"></script> <script src="scripts/scripts.7ce0b4a1.js"></script> </body> </html>
这是脚本文件的一部分
!function(){"use strict";angular.module("strauiApp",["streamlineCore","ui.bootstrap"])}(),
错误是
Uncaught Error: [$injector:modulerr] Failed to instantiate module strauiApp due to: Error: [$injector:modulerr] Failed to instantiate module streamlineCore due to: Error: [$injector:nomod] Module 'streamlineCore' 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.
这里怎么了?缺少什么?您确定streamlineCore模块在strauiApp模块之前插入到scripts/scripts.7ce0b4a1.js中吗?您确定streamlineCore模块在strauiApp模块之前插入到scripts/scripts.7ce0b4a1.js中吗?导致问题的是引导js。这个js是grunt wiredep自动添加的。是引导js导致了这个问题。此js由grunt wiredep自动添加。它被插入到供应商文件中。当我将模块移动到脚本文件时,它看起来已加载,但现在我收到“未能实例化模块ngResource”错误。因此,似乎无法加载供应商文件中的所有模块。文件中模块的顺序很重要。确保每个模块的依赖项在依赖模块之前加载。它被插入供应商文件中。当我将模块移动到脚本文件时,它看起来已加载,但现在我收到“未能实例化模块ngResource”错误。因此,似乎无法加载供应商文件中的所有模块。文件中模块的顺序很重要。确保每个模块的依赖项在依赖模块之前加载。
Uncaught Error: [$injector:modulerr] Failed to instantiate module strauiApp due to: Error: [$injector:modulerr] Failed to instantiate module streamlineCore due to: Error: [$injector:nomod] Module 'streamlineCore' 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.