mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-10 15:15:34 +00:00
Initial Commit for React
This commit is contained in:
19
app/js/pages/controller-export.js
Executable file
19
app/js/pages/controller-export.js
Executable file
@@ -0,0 +1,19 @@
|
||||
angular.module('app').controller('ExportController', ['$scope', '$stateParams', function($scope, $stateParams) {
|
||||
|
||||
$scope.title = $stateParams.title || 'Export';
|
||||
$scope.description = $stateParams.description;
|
||||
|
||||
if ($stateParams.promise) {
|
||||
$scope.export = 'Generating...';
|
||||
$stateParams.promise.then(function(data) {
|
||||
$scope.export = (typeof data === 'object') ? angular.toJson(data, true) : data;
|
||||
});
|
||||
} else {
|
||||
$scope.export = angular.toJson($stateParams.data, true);
|
||||
}
|
||||
|
||||
$scope.onTextClick = function($event) {
|
||||
$event.target.select();
|
||||
};
|
||||
|
||||
}]);
|
||||
Reference in New Issue
Block a user