Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.

Issue with [formControl] input #103

Open
CosminCraciun opened this issue Feb 26, 2021 · 1 comment
Open

Issue with [formControl] input #103

CosminCraciun opened this issue Feb 26, 2021 · 1 comment

Comments

@CosminCraciun
Copy link

When using [formControl] instead of formControlName, styles are not changed on validation failure.

Example:
<input class="form-control" type="text" [formControl]="this.emailControl">
does not change the input class on validation failure.

For context, I'm using FormGroupTyped, so my situation is more like this:
<input class="form-control" type="text" [formControl]="this.formGroup.controls.email">

@sambernet
Copy link

In my case, when using [formControl] the compilation fails altogether, as the type of the [formControl] input binding of the FormControlDirective from ng-bootstrap-form-validation is defined as string - which does ALSO match the conflicting definition in angular's own FormControlDirective, where the type is FormControl - and not string.

ng build thus yields something like this: Type 'FormControl' is not assignable to type 'string'

As far as I can tell, the @Input() formControl: string is in reality not even used in the FormControlDirective 🤔
Could it maybe just be removed??

I reckon the validation wouldn't work for such a "standalone" field, as the selector wouldn't match without that input - but now it actually breaks otherwise working, which is much worse.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants