Below is my partial component code
....
....
ngOnInit()
{
this.service.getData().subscribe( function(data) {
try
{
console.log(JSON.stringify(data)); // {"name":"john"}
this.ajaxdata = data;
}
catch(err)
{
console.log('Error Here....');
}
});
}
....
....
and below is my partial template related code
{{ ajaxdata?.name }}
console.log statement in the above code prints "{"name":"john"}" as expected. But {{ ajaxdata?.name }} does not print "john" , any idea what could be the reason ?
?
afterajaxdata
?