1

私は Yeoman angular genarator を使用しています。Angular モジュールを作成し、それをアプリにロードしようとしました。Grunt は ng-annotate を使用しており、アプリ スクリプトの前にベンダー スクリプト (モジュールがある場所) が読み込まれるため、何が問題なのかわかりません。

これは圧縮された index.html です

<!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("streamlineCore",["configs","ngResource","ui.router","ngMessages","toastr","angular-loading-bar","ipCookie"]).config ...

そして、これはスクリプトファイルの始まりです

!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.

ここで何が問題なのですか?何が欠けていますか?

4

2 に答える 2

0

strauiApp モジュールの前に、scripts/scripts.7ce0b4a1.js に streamlineCore モジュールが挿入されていますか?

于 2016-06-01T10:37:58.887 に答える
0

問題を引き起こしたのはブートストラップjsでした。この js は grunt-wiredep によって自動的に追加されました。

于 2016-06-01T13:50:11.840 に答える