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

Class type interfaces

Class type interfaces define the contract for classes. A class that implements an interface should meet the requirements of the interface:

interface CustomerInterface {     id: number;     firstName: string;     lastName: string;     addCustomer(firstName: string, lastName: string);     getCustomer(id: number): Customer; }  class Customer implements CustomerInterface {     id: number;     firstName: string;     lastName: string;     constructor() { }     addCustomer(firstName: string, lastName: string): void {         // code to add customer     }     getCustomer(id: number): Customer {         // code to return customer where the id match with id parameter     } }  

The class type interface only deals with public members of the class. So, it is not possible to add private ...

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