I have select group and i want to set selected attribute for object with certain id. I'm tried to move this condition in function, but it doesn't help. Even if i simply set [attr.selected]="true"
it's also doesn't help.
<div *ngIf="_albums && _albums.length > 0" class="form-group">
<select class="form-control input-lg" id="selectAlbum" [(ngModel)]="_albumId" name="albumId">
<option *ngFor="let album of _albums" [value]="album.id" [attr.selected]="album.id == 0 ? true : null">
{{album.title}}
</option>
</select>
</div>
It's weird because even this doesn't work:
<option *ngFor="let album of _albums" [value]="album.id" selected>
{{album.title}}
</option>