Rxweb - 如何将数据绑定到具有 @propArray 装饰器的 formGroup

问题描述

我正在为我的项目使用 rxweb-reactive-form-validators

我到处搜索,但没有找到我的问题的任何解决方案,所以在这里发布。

当我尝试使用 fromGroup 方法绑定服务器数据时

this.form = this.rxFormBuilder.formGroup(Model,serverData);

当我的模型包含@propArray 装饰器时出现以下错误-

错误类型错误:无法读取未定义的属性“属性” 在 RxFormBuilder.push../node_modules/@rxweb/reactive-form-validators/fesm5/rxweb-reactive-form-validators.js.RxFormBuilder.checkObjectPropAdditionalValidation (rxweb-reactive-form-validators.js:4219) 在 RxFormBuilder.push../node_modules/@rxweb/reactive-form-validators/fesm5/rxweb-reactive-form-validators.js.RxFormBuilder.formGroup (rxweb-reactive-form-validators.js:4479) 在 rxweb-reactive-form-validators.js:4551

这是我的模型的样子 -

export class Model {

@prop()
id = '';

@propArray(QuestionModel)
questions: QuestionModel[]; // For this I am getting error.
}

如何解决这个错误?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)