0

我收到一个循环依赖错误: Circular dependency found: $notificationService <- $notificationService <- $uiService <- $tourService

  • $notificationService只取决于$rootScope
  • $uiService取决于一些事情,包括$notificationService但不是$rootScope和不是$tourService
  • $tourService取决于很多事情$notificationService,包括$uiService但不是$rootScope

据我所知,没有循环依赖,也绝对不是错误中描述的那种。

通知.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.

4

0 回答 0