i have the following part of html template:
<div class="row">
<div class="medium-3 columns">
<label>Category
<select [(ngModel)]="item.cat" name="cat" required>
<option *ngFor="let a of categories" [ngValue]="a">{{a.name}}</option>
</select>
</label>
</div>
<div class="medium-3 columns">
<label>Categoria
<select [(ngModel)]="item.place" name="place" [disabled]="!item.cat">
<option *ngFor="let c of places" [ngValue]="c">{{c.name}}</option>
</select>
</label>
</div>
</div>
As you can see the second select
is disabled until the users choose one option from first select. So if the users choose an option from the first select, the second select become active.
Now i want to add required
attribute even to the second select. But if i do it the second select
is always disabled.
Isn't this behaviour weird?
Here is the Plunker (thanks to Stefan Svrkota).