1 / 1

Understanding TypeScript Interfaces

An interface is a programming feature that helps to define the expected structure of an object allowing that to serve as a contract of sorts for the class where it is implemented.

hkinfosoft
Download Presentation

Understanding TypeScript Interfaces

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Understanding TypeScript Interfaces Content Source: Angularjs Development Company An interface is a programming feature that helps to define the expected structure of an object allowing that to serve as a contract of sorts for the class where it is implemented. That helps explain the concept but how does this actually translate into working with real world code? Let’s say for example we have the following method: publicrequestSpecificArea(lat : number, lng : number) : Observable { returnthis.http.get(this._api + `locate- neighbourhood?q=${lat},${lng}`); } 1 2 3 4 As you can gather from the code we’re using Angular’s HttpClient class to query a remote API which returns data as an observable that we can subsequently subscribe to. Continue reading

More Related