我收到循环依赖错误:
Circular dependency found: $notificationService <- $notificationService <- $uiService <- $tourService
$notificationService
仅取决于$rootScope
$uiService
取决于几件事,包括$notificationService
,但不是$rootScope
和NOT $tourService
$tourService
取决于许多事物,包括$notificationService
和$uiService
,但不取决于$rootScope
据我所知,没有循环依赖,而且绝对不是错误中描述的依赖。
notification.service.ts:
export class NotificationService {
static $inject = ['$rootScope'];
constructor(private $rootScope: ng.IRootScopeService) {...}
...
}
export default function(mod: ng.IModule) {
mod.service('$notificationService', NotificationService);
}
我不知道$notificationService
如何涉及任何循环依赖项,因为它仅依赖于$rootScope
。