angularjs – 错误:[$injector:nomod]模块’ui.bootstrap’不
发布时间:2020-12-17 08:46:38 所属栏目:安全 来源:网络整理
导读:嗨,我在运行业力测试运行时在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
嗨,我在运行业力测试运行时在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']); 能否请你帮忙 ??
ui.unique是一个来自
angular-ui-utils 的模块.如果被使用,必须包含在karma conf中并注入应用程序.
var myApp = angular.module('myApp',['ui.bootstrap','ui.utils']); 或者你可以专门注入ui.unique而不是注入ui.utils,如果只使用了唯一的模块. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |