【发布时间】:2014-03-27 18:49:40
【问题描述】:
您好,我在运行 karma 测试运行时在 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']);
你能帮忙吗??
【问题讨论】:
标签: angularjs angular-ui-bootstrap karma-runner karma-jasmine