Community Forum
Angular Material support
over 4 years ago by Nikita
Is there any way to make Angular Material Select selected option to save notranslate
attribute? Is there some workaround?
Each item in this list of options has notranslate
This one hasn't (because there is only innerText binded to span.mat-select-value-text
)
Template:
<form [formGroup]="form">
<mat-form-field>
<mat-label>Brand</mat-label>
<mat-select formControlName="brand" [required]="true">
<mat-option *ngIf="!brands?.length" [value]="null">No brands</mat-option>
<mat-option *ngFor="let brand of brands" [value]="brand.name" notranslate>{{brand.name}}</mat-option>
</mat-select>
</mat-form-field>
</form>
Goal is to translate strings 'Brand' and 'No brands' but exclude any string from {{brand.name}}