I have a md-select and a corresponding submit button that I use to call a web-service and pass data from md-select (I am not using any forms here):
<div class="col-8">
<md-select placeholder="Select User" class="custom-select" id="user" name="user" [(ngModel)]="user" floatPlaceholder="never">
<md-option *ngFor="let user of users| keys" [value]="user.key">{{user.value}}</md-option>
</md-select>
</div>
<div class="col-2 mb-3">
<button type="button" class="btn blue-btn" (click)="ws(user)">View Details</button>
</div>
Upon submit and before calling web-service, I want to check whether any option has been selected and display an error message (angular material style) in case none is.
The Angular documentation mentions an errorStateMatcher for mdInput but none for md-select.