我嘗試使用ng-notifications-bar模塊時通知依賴性發現,我有這樣的代碼:角 - 使用ngNotificationsBar
angular.module('app', [
uiRouter,
Common.name,
Components.name,
angularMaterial,
'ngTable',
'gridster',
'ngNotificationsBar'
])
.factory('$exceptionHandler', ['notifications', function(notifications) {
return function(exception, cause) {
notifications.showError({message: exception});
};
}]);
,但得到的錯誤:
[$injector:cdep] Circular dependency found: $rootScope <- notifications <- $exceptionHandler <- $rootScope <- $timeout <- $$rAF <- $mdGesture
我試圖修改庫使用$injector
得到$超時和$ rootScope但這並沒有幫助還試圖用$injector
得到notifications
在$exceptionHandler
工廠,但得到了同樣的錯誤。
什麼是你的'$ injector'嘗試樣子? –
@MattWay'變量$ rootScope = $ injector.get( '$ rootScope');'或'VAR通知= $ injector.get( '通知');' – jcubic
你叫'得到()'內部或外部返回功能? –