Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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