Angular2 Form validation: model-driven form broken after update

岁酱吖の 提交于 2019-12-10 11:38:53

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!