I'm currently working on a Pokedex project with Angular.
Successfully retrieved data from the PokeAPI and able to display regular sprites like this:
<img [src]="pokemon[0].sprites.front_default" [alt]="pokemon[0].name" >
However, encountered errors when trying to display an animated gif from a different directory using:
[src]="pokemon[0].sprites.versions.generation-v.black-white.animated.front_default"
This resulted in two errors indicating:
Property 'v' does not exist on type 'DetailsComponent'.
Property 'white' does not exist on type 'DetailsComponent'.
The issue arises due to parsing text containing hyphens which Angular misinterprets.
What would be the correct approach to parsing the image source without encountering these problems?