/// import coreModule from 'app/core/core_module'; const template = ` `; export class SaveDashboardModalCtrl { message: string; max: number; saveForm: any; dismiss: () => void; /** @ngInject */ constructor(private dashboardSrv) { this.message = ''; this.max = 64; } save() { if (!this.saveForm.$valid) { return; } var dashboard = this.dashboardSrv.getCurrent(); var saveModel = dashboard.getSaveModelClone(); var options = {message: this.message}; return this.dashboardSrv.save(saveModel, options).then(this.dismiss); } } export function saveDashboardModalDirective() { return { restrict: 'E', template: template, controller: SaveDashboardModalCtrl, bindToController: true, controllerAs: 'ctrl', scope: {dismiss: "&"} }; } coreModule.directive('saveDashboardModal', saveDashboardModalDirective);