我最近在我的控制器中实现了flash消息,这导致我的所有业力测试都失败了。我看到另一篇文章建议制作一个假模块并将其注入,但这似乎不是最好的做法。
是否有一种简单的方法可以从我的控制器中模拟'angular-flash'?
编辑:
这是堆栈错误的开始:
Error: [$injector:modulerr] Failed to instantiate module ShopTill due to:
Error: [$injector:modulerr] Failed to instantiate module flash due to:
Error: [$injector:nomod] Module 'flash' 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.
http://errors.angularjs.org/1.4.0/$injector/nomod?p0=flash
at /Users/edobrien/Documents/projects/Clothing-Retailer/bower_components/angular/angular.js:1955
at ensure (/Users/edobrien/Documents/projects/Clothing-Retailer/bower_components/angular/angular.js:1877)
at module (/Users/edobrien/Documents/projects/Clothing-Retailer/bower_components/angular/angular.js:2192)
at /Users/edobrien/Documents/projects/Clothing-Retailer/bower_components/angular/angular.js:4338
at forEach (/Users/edobrien/Documents/projects/Clothing-Retailer/bower_components/angular/angular.js:336)
at loadModules (/Users/edobrien/Documents/projects/Clothing-Retailer/bower_components/angular/angular.js:4364)
at /Users/edobrien/Documents/proj
但是当我查看localhost时它会起作用,所以它必须是测试的问题....任何帮助?