grafana/public/app/features/dashboard/services/UnsavedChangesSrv.ts

24 lines
731 B
TypeScript
Raw Normal View History

import angular, { IQService, ILocationService } from 'angular';
import { ChangeTracker } from './ChangeTracker';
import { ContextSrv } from 'app/core/services/context_srv';
import { DashboardSrv } from './DashboardSrv';
2017-12-21 06:22:20 -06:00
/** @ngInject */
export function unsavedChangesSrv(
this: any,
$rootScope: any,
$q: IQService,
$location: ILocationService,
$timeout: any,
contextSrv: ContextSrv,
dashboardSrv: DashboardSrv,
$window: any
) {
this.init = function(dashboard: any, scope: any) {
this.tracker = new ChangeTracker(dashboard, scope, 1000, $location, $window, $timeout, contextSrv, $rootScope);
2017-12-21 06:22:20 -06:00
return this.tracker;
};
}
angular.module('grafana.services').service('unsavedChangesSrv', unsavedChangesSrv);