7

こんにちは、カルマ テスト ランの実行中に webstorm で次のエラーが発生します。

Error: [$injector:nomod] Module 'ui.bootstrap', 'ui.unique' 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.

インターネットを調べたところ、依存ファイル ui.bootstrap がそのように見逃されている可能性があることを確認するように言われました。

しかし、アプリケーションは正常に動作します

テスト中にのみこのエラーが表示されます

私のkarma.conf.jsで

files: [
            //angular files

            'app/js/vendor/angular/ui.bootstrap.js',
            'app/js/vendor/angular/ui.bootstrap-0.10.0.js',

            'app/js/vendor/angular/angular.js',
            'app/js/vendor/angular/angular-mocks-0.10.6.js',

            'app/js/app.js',
            'test/**/*Spec.js'
        ], 

私のモジュール宣言で

var myApp = angular.module('myApp', ['ui.bootstrap']);

助けていただけませんか??

4

1 に答える 1

6

ui.uniqueからのモジュールですangular-ui-utils。これを使用する場合は、カルマ conf に含め、アプリにも注入する必要があります。

var myApp = angular.module('myApp', ['ui.bootstrap', 'ui.utils']);

または、一意のモジュールのみが使用されている場合は、ui.unique注入する代わりに具体的に注入できます。ui.utils

于 2014-03-27T19:13:51.250 に答える