首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >grunt构建后,即使使用ng-annotate,Angular模块也不可用

grunt构建后,即使使用ng-annotate,Angular模块也不可用
EN

Stack Overflow用户
提问于 2016-06-01 18:24:31
回答 2查看 377关注 0票数 1

我正在使用约曼角度生成器。我创建了Angular模块,并尝试将其加载到应用程序中。Grunt使用ng-annotate,供应商脚本(模块是)在应用脚本之前加载,所以我不知道问题出在哪里。

这是压缩的index.html

代码语言:javascript
复制
<!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>

这是注册模块的供应商文件的一部分

代码语言:javascript
复制
function(){"use strict";angular.module("streamlineCore",["configs","ngResource","ui.router","ngMessages","toastr","angular-loading-bar","ipCookie"]).config ...

这是对脚本文件的乞求

代码语言:javascript
复制
!function(){"use strict";angular.module("strauiApp",["streamlineCore","ui.bootstrap"])}(),

错误是

代码语言:javascript
复制
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.

这是怎么回事?遗漏了什么?

EN

回答 2

Stack Overflow用户

发布于 2016-06-01 18:37:59

确定在strauiApp模块之前插入脚本/脚本7ce0b4a1.js中的streamlineCore模块吗?

票数 0
EN

Stack Overflow用户

发布于 2016-06-01 21:50:12

是bootstrap js导致了这个问题。这个js是由grunt wiredep自动添加的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37565973

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档