O'Reilly logo

Learning Angular for .NET Developers by Rajesh Gunasundaram

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding the AppComponent template

We have the required properties and methods in the AppComponent class. Now, let's add the template to show a todo list, a textbox to get the title of a todo item from the user, an add button to add a new todo item, a checkbox for each todo item to mark them as completed, a button for each todo item to delete them, and a button at the bottom of the template to remove the completed todo items from the todo list. The following is the updated code snippet of AppComponent with all the mentioned features:

<section>       <header>             <h1>todos</h1>           <input placeholder="Add   new todo" autofocus="" [(ngModel)]="newTodoText">           <button type="button"   (click)="addTodo()">Add</button>       </header>    <section *ngIf="todoService.todos.length ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required