getRawValue does not return the raw value of nested controls.
See original GitHub issueI’m submitting a … (check one with “x”)
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
If I have a FormGroup a with a nested FormGroup b, a.getRawValue() only takes the .value of b, meaning that the values of disabled controls within b are not returned.
Expected behavior
I expect a.getRawValue() to return all values within the form.
Minimal reproduction of the problem with instructions
http://plnkr.co/edit/3VMar1qp8X6mHU6HJToA?p=preview values are missing from the output.
Updated version with both FormGroup and FormArray: http://plnkr.co/edit/m9OrFDi3c7qmMoWDtS1A?p=preview
What is the motivation / use case for changing the behavior? Current behaviour is unexpected.
- Angular version: 2.1.0
The code looks the same in the latest version though.
- Language: [TypeScript]
Issue Analytics
- State:
- Created 7 years ago
- Reactions:8
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Nested Angular FormGroups getRawValue / patchValue from ...
I'm using this workaround instead of Angulars FormGroup getRawValue() , which works for nested groups: /** * @param control a FormControl or ...
Read more >AbstractControl - Angular
The optional type parameter TRawValue represents the raw value type ( control.getRawValue() ). Constructorlink. Initialize the AbstractControl instance.
Read more >Angular Reactive Forms: Tips and Tricks | by Netanel Basal
In order to get the complete form's values, we can use the FormGroup.getRawValue() method. Control Getters and Setters. I want to talk about...
Read more >Angular FormArray - Complete Guide
getRawValue (): Gets the values of all form controls, via the control.value property of each control. Let's now learn how we can use...
Read more >How to Use Angular FormArray(s) within FormGroup(s) In ...
Are you trying to use a FormArray on a dynamic/reactive Angular Form, but it is not working? This should help you solve your...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@mhevery Why was this closed? This still doesn’t work and has been marked as severity3: broken
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.