简体   繁体   中英

How to get Data from JSON file, how can I parse the Date object to retrieve the data?

export interface blog { 
  id: number; 
  name: any; 
  status: any; 
  active: string; 
  modifiedAt: Date; 
}

How does your JSON file looks like?
Second where from are you trying to get the JSON from a server or you have defined somewhere in your code as file. Third you need to create an empty array of objects which at you it is blog and then to parse that Json to this blog and then through *ngFor you can easily show data in your UI which depends on your HTML.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM