ng-content passed into MatAutoComplete does not display options passed in

228 views Asked by At

I am trying to create a component which will pass in mat-option's to mat-autocomplete but the passed in options do not appear.

My component:

<mat-autocomplete #auto="matAutocomplete" (optionSelected)='optionSelectedEvent($event)'>
    <!-- <mat-option >before</mat-option> -->
    <ng-content>

    </ng-content>
  </mat-autocomplete>

Parent Component:

<app-search-select placeholder="AND/OR..." (filter)="filter($event)" (optionSelected)='optionSelected($event)'>
  <mat-option *ngFor="let logicGate of filteredValues | async" [value]="logicGate">
    {{logicGate}}
  </mat-option>
</app-search-select>

note that if I uncomment the preset option in the component all the options display. Is there something I need to implement to mat-autocomplete update with the ng-content

0

There are 0 answers