I am using the ng2-select component to extend another component - I called it my-dropdown-field. However the ng2-select component does not render for some reason. The issue does not seem to be in the ng2 control, but rather in the wrapper control I created. I am however not able to figure out what is causing this. There are no errors thrown either. If I use ng2-select on it's own its working fine. I created a reproducible stackblitz.
https://stackblitz.com/edit/ng2-select-angular2
If you run this, you will see there is no ng2-select control being rendered. If you comment out the below section from the app.component.html:
Doesn't work
<form [formGroup]="myGroup" (submit)="showForm()">
<my-dropdown-field
name="country"
[items]="items"
[selectedItem]="active"
formControlName="country">
</my-dropdown-field>
<button (click)="showForm()">Show</button>
</form>
and uncomment this from the top:
Works
<form [formGroup]="myGroup" (submit)="showForm()">
<ng-select
name="country"
[(ngModel)]="active"
[(active)]="active"
[items]="items"
formControlName="country">
</ng-select>
<button (click)="showForm()">Show</button>
</form>
Then you will see that it works just fine.
Here is the link to the original ng2-select component:
https://github.com/valor-software/ng2-select
What am I missing?