Is there a way to pass the value selected from one of the options to another component using ngModel? I am able to save the value with ngModel but struggling to figure out how to pass it.
Component1.ts
<select [(ngModel)]="selectedElement.id">
<option *ngFor="let type of types" [ngValue]="type.id"> {{type.Name}}</option>
</select>
@Input() selectedElement:any= {id:2,Name:'abdfsdgsc'};
types:any[]=[
{id:1,Name:'abc'},
{id:2,Name:'abdfsdgsc'}
];
component2.ts
constructor() {
if(this.selectedElement.id==1){
themeConfig.config();
}else {
themeConfig.theme();
}
}