Override ngControl in component providers #420
Unanswered
mariusbrinzaru
asked this question in
Q&A
Replies: 1 comment 1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm submitting a...
Current behavior
I have PatientCreditCardComponent that extends BaseCompositeFormField
`
export abstract class BaseCompositeFormField implements Validator, OnInit, OnDestroy {
public form: FormGroupTyped;
protected _destroy$: Subject = new Subject();
constructor(@optional() @self() public controlDir: NgControl) {
// bind the CVA to our control
controlDir.valueAccessor = this;
}
ngOnInit(): void {
let control = this.controlDir.control;
this.initForm(control.validator);
`
and i am trying to test the PatientCreditCardComponent but i get the following error =>
here is a relevant snippet of my spec
Expected behavior
To inject or override ngControl in order to let me test
Minimal reproduction of the problem with instructions
For bug reports please provide the STEPS TO REPRODUCE and if possible a MINIMAL DEMO of the problem via
https://stackblitz.com or similar (you can use this template as a starting point: https://bit.ly/2zme3bj).
What is the motivation / use case for changing the behavior?
Environment
Beta Was this translation helpful? Give feedback.
All reactions