Hi,
I have the below code in the view:
<select [ngModel]="selectedUserId" name="xx" class="form-control"
required>
<option [value]="">Select your user </option>
<option [value]="user.userId" *ngFor="let user of
users">{{user.username}}</option>
</select>
<button type="button" class="btn
btn-lg btn-success btn-block" (click)="validateUsername()">Continue</button>
In the Controller, I have the below code:
validateUsername(): void {
console.log("selected user Id:"+ this.selectedUserId)
}
For some reason, I am not getting the selected value. Can some one please
help?
Thanks
--
You received this message because you are subscribed to the Google Groups
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.