i399exng1/app/details.ctrl.js

28 lines
493 B
JavaScript
Raw Normal View History

2017-03-13 12:29:29 +02:00
(function () {
'use strict';
angular.module('app').controller('DetailsCtrl', Ctrl);
function Ctrl($http, $routeParams, $location) {
var vm = this;
vm.task = {};
vm.back = back;
init();
function init() {
$http.get('api/tasks/' + $routeParams.id).then(function (result) {
vm.task = result.data;
});
}
function back() {
$location.path('/list');
}
}
})();