The viewChild won't work in this case beccause the component is inside a ng-template.
You need to use *ngTemplateOutletenter
*ngTemplateOutletenter
I explain it in this in this topic