|
|
@@ -1,8 +1,7 @@
|
|
|
-///<reference path="../../../headers/common.d.ts" />
|
|
|
-
|
|
|
import angular from 'angular';
|
|
|
-import coreModule from 'app/core/core_module';
|
|
|
+import {saveAs} from 'file-saver';
|
|
|
|
|
|
+import coreModule from 'app/core/core_module';
|
|
|
import {DashboardExporter} from './exporter';
|
|
|
|
|
|
export class DashExportCtrl {
|
|
|
@@ -22,9 +21,8 @@ export class DashExportCtrl {
|
|
|
}
|
|
|
|
|
|
save() {
|
|
|
- var blob = new Blob([angular.toJson(this.dash, true)], { type: "application/json;charset=utf-8" });
|
|
|
- var wnd: any = window;
|
|
|
- wnd.saveAs(blob, this.dash.title + '-' + new Date().getTime() + '.json');
|
|
|
+ var blob = new Blob([angular.toJson(this.dash, true)], {type: 'application/json;charset=utf-8'});
|
|
|
+ saveAs(blob, this.dash.title + '-' + new Date().getTime() + '.json');
|
|
|
}
|
|
|
|
|
|
saveJson() {
|
|
|
@@ -44,7 +42,7 @@ export function dashExportDirective() {
|
|
|
controller: DashExportCtrl,
|
|
|
bindToController: true,
|
|
|
controllerAs: 'ctrl',
|
|
|
- scope: {dismiss: "&"}
|
|
|
+ scope: {dismiss: '&'},
|
|
|
};
|
|
|
}
|
|
|
|