Files
coriolis/app/js/controllers/controller-export.js
Colin McLeod 3f8cf106a1 Linting fixes
2015-06-11 17:23:13 -07:00

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();
};
}]);