2
依賴加載模塊我有一個被定義爲這樣一個模塊:與茉莉花
var angular_multi_select_engine = angular.module('angular-multi-select-engine', [
'angular-multi-select-constants'
]);
的engine
取決於constants
模塊上,你可以看到。
我試圖在其上運行engine
一些測試,這一點:
beforeEach(function() {
angular.mock.module('angular-multi-select-engine', 'angular-multi-select-constants');
});
但是當我嘗試運行茉莉,它說:
Error: [$injector:modulerr] Failed to instantiate module angular-multi-select-engine due to:
[$injector:nomod] Module 'angular-multi-select-engine' 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.
如果我只嘗試加載constants
模塊,Jasmine按預期工作,我可以測試constants
模塊的值。
我該如何加載一個具有依賴性的模塊?