angular reactive forms select option code example
Example 1: select option in reactive forms
City: any = ['Florida', 'South Dakota', 'Tennessee', 'Michigan']
Example 2: select option in reactive forms
import { Component } from '@angular/core';
import { FormBuilder, Validators } from "@angular/forms";
@Component({
})
export class AppComponent {
constructor(public fb: FormBuilder) { }
registrationForm = this.fb.group({
cityName: ['']
})
onSubmit() {
alert(JSON.stringify(this.registrationForm.value))
}
}