Я думаю, вам нужно прочитать о формах в Angular здесь
app.component.html
<div style="text-align:center">
<select class="select1" [(ngModel)]="selectOneVal">
<option value="country1">country1</option>
<option value="country2">country2</option>
<option value="country3">country3</option>
</select>
<select class="select2" [(ngModel)]="selectTwoVal">
<option value="state1">state1</option>
<option value="state2">state2</option>
<option value="state3">state3</option>
</select>
<button (click)="save()">save</button>
</div>
<small>
selectOneVal: {{ selectOneVal}}
</small>
<br/>
<small>
selectTwoVal: {{ selectTwoVal}}
</small>
app.component.ts
import { Component } from "@angular/core";
@Component({
selector: "app-root",
templateUrl: "./app.component.html",
styleUrls: ["./app.component.css"]
})
export class AppComponent {
title = "CodeSandbox";
toggle: boolean = true;
click: any;
selectOneVal: any;
selectTwoVal: any;
ngOnInit() {
this.selectOneVal = "country1";
this.selectTwoVal = "state1";
}
save() {
console.log(this.selectOneVal);
console.log(this.selectTwoVal);
}
}
app.module.ts
import { BrowserModule } from "@angular/platform-browser";
import { NgModule } from "@angular/core";
import { AppComponent } from "./app.component";
import { FormsModule } from "@angular/forms";
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, FormsModule],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {}
вот рабочий ответ на codesandbox