Issue
I have a response like:
[
{
"id": 1,
"title": "ab",
"description": "gazeta",
"published": true,
"comments": [
{
"id": 1,
"content": null
},
{
"id": 3,
"content": null
},
{
"id": 4,
"content": null
}
]
}
]
How can I make tree in Angular? Any examples of impelementation, or documentation, or working example.
Solution
create an interface:
export interface yourInterface{
id: number;
title: string;
description: string;
published: boolean;
comments: {id: number; content: string;}[]
}
and declare your http request like this:
this.httpService.get<yourInterface[]>('url...')
Answered By - Eli Porush
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.