Check out this HTML select element:
<select id="editProfileForm:AttributesList"
name="editProfileForm:AttributesList"
size="6" class="allLists"
[(ngModel)]="atr1" >
<option *ngFor="#attr of attributes"(click)="onSelect(attr, attr.domainDiscrete)">
{{attr.name}}
</option>
</select>
Here's the corresponding code in my component:
onSelect(attclickname: Attribut, statusDiscret: boolean)
{
this.selectedAttr = attclickname;
this._discret = statusDiscret;
}
Upon clicking on an option (i.e., attribute name), it retrieves the operators and values associated with that attribute. Wanting to set the first option as default when clicked.