angular reactive forms select option code example

Example 1: select option in reactive forms

// City Names
  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) { }

  /*########### Form ###########*/
  registrationForm = this.fb.group({
    cityName: ['']
  })

  onSubmit() {
    alert(JSON.stringify(this.registrationForm.value))
  }

}