I am trying to pass value selected from one of the options. I used ngModel to save the value but I can't figure out how to pass it to other component.
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();
  }
}
 
     
     
    