mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 22:33:24 +00:00
19 lines
472 B
JavaScript
Executable File
19 lines
472 B
JavaScript
Executable File
angular.module('app').controller('ExportController', ['$scope', '$stateParams', function($scope, $stateParams) {
|
|
|
|
$scope.title = $stateParams.title || 'Export';
|
|
|
|
if ($stateParams.promise) {
|
|
$scope.export = 'Generating...';
|
|
$stateParams.promise.then(function(data) {
|
|
$scope.export = data;
|
|
});
|
|
} else {
|
|
$scope.export = angular.toJson($stateParams.data, true);
|
|
}
|
|
|
|
$scope.onTextClick = function($event) {
|
|
$event.target.select();
|
|
};
|
|
|
|
}]);
|