mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 22:33:24 +00:00
17 lines
458 B
JavaScript
Executable File
17 lines
458 B
JavaScript
Executable File
angular.module('app').controller('LinkController', ['$scope', 'Utils', '$stateParams', function($scope, Utils, $stateParams) {
|
|
$scope.url = $stateParams.url;
|
|
$scope.shortenedUrl = 'Shortening...';
|
|
|
|
$scope.onTextClick = function($event) {
|
|
$event.target.select();
|
|
};
|
|
|
|
Utils.shortenUrl($scope.url)
|
|
.then(function(url) {
|
|
$scope.shortenedUrl = url;
|
|
}, function(e) {
|
|
$scope.shortenedUrl = 'Error - ' + e.statusText;
|
|
});
|
|
|
|
}]);
|