Dart: 1.24.2;
Angular: 4.0.0;
I created some CSS rules based on
.ng-valid
.ng-invalid
ng-valid
ng-invalid
<form>
</form>
ng-valid
class="_ngcontent-umj-2"
<form #form="ngForm" [class.ng-valid]="form.valid" [class.ng-invalid]="!form.valid">
Yes, this behavior changed in a recent release of angular_forms
.
Previously, the NgControlStatus
directive was included in list of formDirectives
. However, this caused every component that used forms to pay the price for these host bindings.
Now, if you want the behavior, you need to include NgControlStatus
explicitly in the directives
list of the @Component
.