为什么我不能注入这样的服务?
service('actionService',function (sessionService) {
this.doAction = function () {
return 5;
}
});
service('sessionService',function (userService) {
this.get = function {
if(userService.check()){
//do other stuffs
}
}
});
service('userService',function (actionService) {
this.check = function () {
actionService.doAction();
if(x = 9){
return true;
}else{
return false;
}
}
});
我进入"Circular injection error"
控制台
现在如何处理?
这里有一个更好的代码: http: //pastebin.com/wS32UNCq