Back
AngularJS Compiler
Clear
Run
HTML + CSS
AngularJS 1.8
Task Manager
Hello, {{vm.name}}!
Add Task
Tasks
Filter:
{{task.title}}
Remove
AngularJS Code
angular.module("demoApp", []) .controller("MainCtrl", function() { var vm = this; vm.name = "Developer"; vm.newTask = ""; vm.query = ""; vm.tasks = [ { title: "Wire up controller", done: true }, { title: "Use two-way binding", done: false }, { title: "Filter tasks", done: false } ]; vm.addTask = function() { var title = (vm.newTask || "").trim(); if (!title) { return; } vm.tasks.push({ title: title, done: false }); vm.newTask = ""; }; vm.removeTask = function(index) { vm.tasks.splice(index, 1); }; });
Output