I have a form with a select input as a component - so the form component holds children components for each field type (text, select, textarea, etc.). I want to be able to load data and display it in the form . The problem is with the material-select, i can't set value , i've read about using [compareWith] directive - but i don't know how to trigger it. To simulate sending the data to the i've created a button that changes the @Input value in the Select Component and by that - triggers the [compareWith] - but i guess it's not the solution.
Here is the main component structure :
 <form [formGroup]="contactForm" >
    <mat-form-field class="example-full-width" appearance="fill">
      <mat-label>Full Name </mat-label>
      <input matInput placeholder="Full Name" value="" formControlName="fullName">
    </mat-form-field>
  <br>
    <mat-form-field class="example-full-width" appearance="fill">
      <mat-label>Email </mat-label>
      <input type = "email" matInput placeholder="Email" value="" formControlName="email">
    </mat-form-field>
    <br>
    // select component *
    <select-multiple-example [formObj]="contactForm" [selectedValue]="selectedVal">
    </select-multiple-example>
  </form>
  
<button mat-raised-button color="primary" (click)="setSelectValue()">set value</button>
I'm adding 2 examples for better understanding of the issue:
- The first is my attempt to trigger the select-multiple-example and set a value from it's input
- The second is a working example of setting a value ad a standalone component
Example of the selection working as an independent component

