How can I dynamically insert two svg flag images into a mat-select-trigger based on the user's language selection? Here is my code for reference:
https://i.sstatic.net/SJ8lu.png https://i.sstatic.net/MG2zP.png
HTML
<div class="select-container">
<mat-select class="select-language placeholder-light" [(value)]="selectedLanguage" #selLang (selectionChange)="setLang(selLang.value)" disableOptionCentering>
<mat-option value="pt-br"&mt;
<img class="img" [src]="'./assets/flagIcons/br_flag.svg'">
{{ 'header.language.pt-br' | translate }}
</mat-option>
<mat-option value="en">
<img class="img" [src]="'./assets/flagIcons/usa_flag.svg'">
{{ 'header.language.en' | translate }}
</mat-option>
</mat-select>
</div>
TS
constructor(private readonly translate: TranslateService) {}
public setLang(lang: string) {
this.translate.use(lang);
}
SVG Images stored in Assets folder