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

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