Sha256: 0f7f43b02d5ab8d1976f8fd56f109a12608f7abc116bee7069f4a8b02e97e1ab
Contents?: true
Size: 1.49 KB
Versions: 32
Compression:
Stored size: 1.49 KB
Contents
!(angular => { 'use strict'; class ResultController { constructor($scope, getResultCsv, AlertFlash, $window) { this._alertFlash = AlertFlash; this._$window = $window; this.getCsv = () => getResultCsv(this.result.item.id); /* Need to poll in the directive otherwise wonky-ness occurs in the UI When we run from the query details tab */ this.result.poller.poll(); $scope.$on('$destroy', () => { this.result.poller.unPoll(); }); } resultHasParameters() { if (!this.result.item.parameters) { return false; } else { return _.keys(this.result.item.parameters).length > 0; } } deleteResult() { return this.result.destroy().then(result => { this._alertFlash.emitInfo('Result id = ' + result.id + ' has be deleted!'); if (this.results) { this.results.remove(result); } else { return result; } }); } } ResultController.$inject = ['$scope', 'getResultCsv', 'AlertFlash', '$window']; function resultComponent() { return { restrict: 'E', scope: { 'result': '=', 'results': '=' }, templateUrl: 'result', controller: 'ResultController', controllerAs: 'resultCtrl', bindToController: true }; } angular .module('alephDirectives.result', ['alephServices']) .controller('ResultController', ResultController) .directive('result', resultComponent); }(angular));
Version data entries
32 entries across 16 versions & 1 rubygems