December 2017
Beginner
372 pages
10h 32m
English
We start by creating a new file called IArticle in our model's folder and add the following code to the IArticle interface:
export interface IArticle{ author:string; title:string; description: string; url:string; urlToImage:string; publishedAt:string; getFormattedDate():string;}
The IArticle interface contains all the properties required by the Article class and a getFormattedDate function, which is responsible for converting the date from ISO format to yyyy-mm-dd format. In the first line, before the interface keyword, you can see that there is another keyword, export. We will discuss export in the next chapter but, for now, let's look at the basic definition of the export keyword and why it is ...
Read now
Unlock full access