diff --git a/app/app.js b/app/app.js index 9f012f3..5169565 100644 --- a/app/app.js +++ b/app/app.js @@ -1,6 +1,6 @@ (function () { 'use strict'; - angular.module('app', ['ngRoute']); + })(); diff --git a/app/details.ctrl.js b/app/details.ctrl.js index 18b9602..f77a545 100644 --- a/app/details.ctrl.js +++ b/app/details.ctrl.js @@ -3,23 +3,7 @@ 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'); - } + function Ctrl() { } diff --git a/app/details.html b/app/details.html index 9416c17..e69de29 100644 --- a/app/details.html +++ b/app/details.html @@ -1,4 +0,0 @@ -Title: {{ vm.task.title }}
-Added: {{ vm.task.added | date : 'HH:mm' }} -

- diff --git a/app/list.ctrl.js b/app/list.ctrl.js index 0ad8f8c..18d73d3 100644 --- a/app/list.ctrl.js +++ b/app/list.ctrl.js @@ -3,39 +3,9 @@ angular.module('app').controller('ListCtrl', Ctrl); - function Ctrl($http, modalService) { - var vm = this; - vm.tasks = []; - vm.newTitle = ''; + function Ctrl() { - vm.addTask = addTask; - vm.removeTask = removeTask; - - init(); - - function init() { - $http.get('api/tasks').then(function (result) { - vm.tasks = result.data; - }); - } - - function addTask() { - var newTask = { - title: vm.newTitle, - added: new Date() - }; - - $http.post('api/tasks', newTask).then(init); - - vm.newTitle = ''; - } - - function removeTask(id) { - modalService.confirm() - .then(function () { - return $http.delete('api/tasks/' + id); - }).then(init); - } } + })(); diff --git a/app/list.html b/app/list.html index b6f7a05..e69de29 100644 --- a/app/list.html +++ b/app/list.html @@ -1,9 +0,0 @@ -
- {{ task.title }} - X -

- - - - - diff --git a/index.html b/index.html index 44a4268..d11db3a 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ - + Ng1 @@ -13,15 +13,9 @@ -
+ - - - - - -