I know this's been asked many times before. But I cannot find a solution that works for me.
I have a template driven form with a control which marked as required and passed via ngTemplateOutlet. Form is valid even when I don't have value on the control.
Tried all possible
viewProviders: [{ provide: ControlContainer, useExisting: NgForm }],
AND
viewProviders: [{
provide: ControlContainer,
useFactory: (container: ControlContainer) => container,
deps: [[new SkipSelf(), ControlContainer]],
}]
but no luck
If you could make this Stackbliz work, that would be awesome
https://stackblitz.com/edit/angular-xm3nf7
Note: I cannot put the template inside the form as there are other parts accessing it.