Set $rootScope in DatasourceSrv

(cherry picked from commit 97db9ece98)
This commit is contained in:
rozetko
2018-06-26 18:15:52 +02:00
committed by Marcus Efraimsson
parent f48ea5eea6
commit 381f3da30e
@@ -7,7 +7,7 @@ export class DatasourceSrv {
datasources: any;
/** @ngInject */
constructor(private $q, private $injector, $rootScope, private templateSrv) {
constructor(private $q, private $injector, private $rootScope, private templateSrv) {
this.init();
}
@@ -61,7 +61,7 @@ export class DatasourceSrv {
this.datasources[name] = instance;
deferred.resolve(instance);
})
.catch(function(err) {
.catch(err => {
this.$rootScope.appEvent('alert-error', [dsConfig.name + ' plugin failed', err.toString()]);
});