AngularJS Example:
HTML
<div ng-app="todoApp">
<h2>Todo</h2>
<div ng-controller="TodoController">
<ul>
<li ng-repeat="todo in todos">
<input type="checkbox" ng-model="todo.done">
<span class="done-{{todo.done}}">{{todo.text}}</span>
</li>
</ul>
<form ng-submit="addTodo()">
<input type="text" ng-model="todoText">
<input type="submit" value="add">
</form>
</div>
</div>
CSS
<style>
.done-true {
text-decoration: line-through;
color: grey;
}
JavaScript
angular.module('todoApp', [])
.controller('TodoController', function($scope) {
$scope.todos = [
{text:'apprendre angular', done:true},
{text:'faire une appli angular', done:false}];
$scope.addTodo = function() {
$scope.todos.push({text: $scope.todoText, done: false});
$scope.todoText = '';
};
});