问题
Since I updated from Angular 2.0.0 to 2.4.4 today, my model driven form isn't working anymore.
this.creationForm = this.fb.group({
...
SomeProp: [[], [<any>Validators.required]]
});
SomeProp
should be valid when at least one value is in the array. When debugging I saw that there are some values in the array. Somehow it's still invalid.
I'm not sure if I missed any breaking changes.
Update January 23th
I downgraded to forms@2.4.1. The issue isn't existing anymore. So the "fix" mentioned in the changelog broke it for me. I will check with the next update and get active if it isn't fixed then.
来源:https://stackoverflow.com/questions/41769431/angular2-form-validation-model-driven-form-broken-after-update