TODO with AngularJS
- ng-repeat
- ng-click
<script src="angular.min.js"></script>
<script src="todo1.js"></script>
<div ng-app="todoApp" ng-controller="todoController">
<input ng-model="title"><button ng-click="add()">Add</button>
<ul>
<li ng-repeat="t in tasks">{{ t }}</li>
</ul>
</div>
angular.module('todoApp', [])
.controller('todoController', ['$scope', function($scope) {
$scope.tasks = [];
$scope.add = function() {
$scope.tasks.push($scope.title);
}
}]);
- ENTER does not work
- Reload removes data