<html ng-app="tasksApp">
<head>
	<script src="javascripts/angular/angular.js"></script>
	<script src="javascripts/taskcontroller.js"></script>	
</head>
<body ng-controller="TaskController as taskController">
	Tasks: {{taskController.tasks.length}}
	
	<p>{{taskController.updateMessage}}</p>
	<p></p>
	Create New Task:
		<form>
			<table>
				<tr><td>Name</td><td><input type="text" ng-model="taskController.newTask.name"></input></td></tr>
				<tr><td>Month</td><td><input type="text" ng-model="taskController.newTask.month"></input></td></tr>
				<tr><td>Day</td><td><input type="text" ng-model="taskController.newTask.day"></input></td></tr>
				<tr><td>Year</td><td><input type="text" ng-model="taskController.newTask.year"></input></td></tr>
				<tr><td><input type="submit" value="add" ng-click="taskController.addATask();"></input></td></tr>
			</table>
		</form>
	
	<table>
		<tr><th>Name</th><th>Due date</th><th></th></tr>
		<tr ng-repeat="task in taskController.tasks | orderBy: ['year', 'month', 'day', 'name']">
			<td>{{task.name}}</td>
			<td>{{task.month}}/{{task.day}}/{{task.year}}</td>
			<td><input type="button" value="delete" ng-click="taskController.deleteTask(task);"></input></td>
		</tr>
	</table>
</body>
</html>