I have the following form-modal component:
<div class="modal-header">
<h4 class="modal-title">{{title}}</h4>
<button type="button" class="close" aria-label="Close"
(click)="activeModal.dismiss('Cross click')">
</button>
</div>
<ng-content #form></ng-content>
<div class="modal-footer">
<button class="btn btn-primary btn-danger" (click)="onCancel()">
Cancel
</button>
<button class="btn btn-primary btn-success" type="submit" form="formModal" [disabled]="form.formModalGroup?.invalid">
Save
</button>
</div>
ng-content itself holds the specific form. The question is how to get the formGroup validity status from the ng-content to this parent form-modal component. I have tried bubbling an event from the specific form component, also @ContentChild, and I also have come up with this very similar question:
Disable/Enable submit button in parent component when forms are in child component
But that fix doesn't seem to work when adding the reference directly to the ng-content tag.