在 Angular 中使用 ngformly 从 json 创建时出错 5
Error creating from json using ngformly in Angular 5
我正在使用 Angular 5 使用 ng-formly 库创建表单,但我遇到了下面的错误。我在网上用了他们的例子,但是在我的项目中使用时,看不出为什么他们的核心项目有问题。
OrderComponent.html:33 ERROR TypeError: Cannot add property model, object is not extensible
at eval (ngx-formly-core.js:90)
at Array.forEach (<anonymous>)
at assignModelToFields (ngx-formly-core.js:86)
at FormlyFormBuilder.buildForm (ngx-formly-core.js:503)
at FormlyForm.ngOnChanges (ngx-formly-core.js:825)
at checkAndUpdateDirectiveInline (core.js:12407)
at checkAndUpdateNodeInline (core.js:13935)
at checkAndUpdateNode (core.js:13878)
at debugCheckAndUpdateNode (core.js:14771)
at debugCheckDirectivesFn (core.js:14712)
知道为什么我会收到此错误消息吗?
问题是我在 html 中的表单绑定设置错误。而不是 [model]="model",我有 (model)="model"。问题已解决。
我正在使用 Angular 5 使用 ng-formly 库创建表单,但我遇到了下面的错误。我在网上用了他们的例子,但是在我的项目中使用时,看不出为什么他们的核心项目有问题。
OrderComponent.html:33 ERROR TypeError: Cannot add property model, object is not extensible
at eval (ngx-formly-core.js:90)
at Array.forEach (<anonymous>)
at assignModelToFields (ngx-formly-core.js:86)
at FormlyFormBuilder.buildForm (ngx-formly-core.js:503)
at FormlyForm.ngOnChanges (ngx-formly-core.js:825)
at checkAndUpdateDirectiveInline (core.js:12407)
at checkAndUpdateNodeInline (core.js:13935)
at checkAndUpdateNode (core.js:13878)
at debugCheckAndUpdateNode (core.js:14771)
at debugCheckDirectivesFn (core.js:14712)
知道为什么我会收到此错误消息吗?
问题是我在 html 中的表单绑定设置错误。而不是 [model]="model",我有 (model)="model"。问题已解决。