this is my server response for quetions and answers.. its a array.
[
{
\"id\": 1,
\"product\": 1,
\"user\": \"alex\",
\"text\
Accepted answer Working for one level question. If really want to work in nested scenario: Please check below option
export class QuestionList
{
questions:Question[];
}
export class Question
{
text:string;
answer:Answer;
nextquestions:QuestionList;
}
export class Answer
{
text:string;
}
@Component({
selector: 'question-view',
template: `
-
{{q.text}}:{{q.answer.text}}
`
})
export class QuestionViewComponent {
@Input() questions: any[];
}