Here is an example related to my inquiry
example.component.html
<div class="center">
<div class="form-group" >
<label>Choose a Country</label>
<select class="form-control">
<option *ngFor="let option of options">{{option.name}}</option>
</select>
<button><a [routerLink]="[option.value]">Submit</a></button>
</div>
</div>
example.component.ts
export class SelectLocationComponent {
selectedOption: string;
options = [
{ name: "All Countries", value: '/allcountries' },
{ name: "India", value: '/india' }
]
}
I need to access the selected option value in the routerlink
from the example.component.ts