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 a Todo class

Our application deals with Todo items. So, let's create a class named Todo and add properties such as title and completed to it, as illustrated:

export class Todo {       title: string;       completed: boolean;       constructor(title: string) {           this.title = title;           this.completed = false;       }       set isCompleted(value:   boolean) {           this.completed = value;       }   }   

This Todo class also has a constructor that takes title as a parameter and a method that sets the todo item as completed.

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