I am getting an error when performing an http get call for JSON data where the JSON has a ‘#’ in the path. Everything is working and returning/displaying except for when i try to display an image where the path has ‘#’ in it.
in the JSON return below i am trying to display the image at artist.image[3].#text
Here is the JSON returned:
"artist":{
"name":"Adele",
"mbid":"cc2c9c3c-b7bc-4b8b-84d8-4fbd8779e493",
"url":"https://www.last.fm/music/Adele",
"image":[
{
"#text":"https://lastfm-img2.akamaized.net/i/u/34s/06ecd99174a97c8319aabd69c3312a32.png",
"size":"small"
},
{
"#text":"https://lastfm-img2.akamaized.net/i/u/64s/06ecd99174a97c8319aabd69c3312a32.png",
"size":"medium"
},
{
"#text":"https://lastfm-img2.akamaized.net/i/u/174s/06ecd99174a97c8319aabd69c3312a32.png",
"size":"large"
}
....
This Works
<ion-list>
<ion-item *ngFor="let song of songs | musicsearchfilter">
<h2>{{song?.artist}}</h2>
<p>{{song?.name}}</p>
</ion-item>
</ion-list>
BUT when I try to display the image
<img src="{{song?.image[3].#text}}">
I get the following error:
Parser Error: Unexpected token #