Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/storePublic

Question: How can the forms plugin update a form array of objects? #1844

Open
@markwhitfeld

Description

@markwhitfeld

Originally posted by@irowbin in#1745 (comment) on 10 May 2021

Hi there, I have been struggling to patching the state ofFormArray values using this plugin.

I have something like this in component:

fg=this.fb.group({anyTerms:this.fb.array([this.fb.group({term:[]})]),})

now if I add more than one object in that array, it populates state values as[{term:'1'}, {term:'2'}] but it can't be populated from state toFormArray

The structure like this requires to create anAbstractControl but couldn't find a way to do from the state to component.

example:

[{term:'1'},{term:'2'}].forEach(obj=>this.controls.push(this.fb.group(obj)))

Is it done internally or something?

Looks like it was updated usingthis line which only care about raw value.

Can we have type check and patch value instead of raw?

Thanks,
Regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp