I am trying to implement a small logic, where depending on the API property should be rendered different icons.
The API sends 3 types of media_type:
- image
- video
- album
I just want to display different icons based on those 3 types.
In react.js I would do :
{
data.media_type==='image'
?
<mat-icon svgIcon="image" aria-hidden="false"></mat-icon>
:
data.media_type==='video'
?
<mat-icon>video</mat-icon>
:
<mat-icon>album</mat-icon>
}
How can I do similar in Angular?
Any help will be appreciated.