@PrabhatBees wrote:
Hi,
I have a list of hard-coded objects as:
public Heroes = [{
id : ‘1’,
name : ‘John Smith’
},{
id : ‘2’,
name : ‘Peter Parker’
},
{
id : ‘3’,
name : ‘Bruce Wayne’
}
];I am using, autocompleteListFormatter as:
autocompleteListFormatter = (data: any): SafeHtml =>{
let html =<span>${data.id}</span>
;
return this._sanitizer.bypassSecurityTrustHtml(html);
}and, my html file looks like this:
{{ model1 | json }}When I run this, I get the desired output.
{ “id”: “1”, “name”: “John Smith”}However, I would like those curly brackets removed, and get these data in nicely html formatted without Id and Name field, like:
1
John SmithThis must be simpler than I thought, but I have been looking for it since 2 days, and could not find a way. I am a newbie, and learning Ionic since a month. If someone know the way, please do help.
Thank you.
Posts: 1
Participants: 1