mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 14:33:22 +00:00
16 lines
458 B
JavaScript
Executable File
16 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;
|
|
});
|
|
|
|
}]); |