Within my code, there is a variable named "data" that holds the following information:
{
id: 1,
date: "2018-03-13T16:18:03",
date_gmt: "2018-03-13T16:18:03",
guid: {},
modified: "2018-05-03T17:25:36",
modified_gmt: "2018-05-03T17:25:36",
slug: "hello-world",
status: "publish",
type: "post",
title: {
rendered: "Hello world!"
},
When I output the id in app.component.html using the following syntax, it works perfectly:
[ngModel]="data?.id"
However, I encounter an issue when trying to display the title.
Using the code below results in seeing [object Object]
:
[ngModel]="data?.title.rendered"
But using this alternative code successfully displays the title:
value="{{data?.title.rendered}}"
How can I make
[ngModel]="data?.title.rendered"
show the title instead of [object Object]
?