Repository navigation
Closed
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: docsRelated to the documentationarea: formsgood first issueLabel noting a good first issue to be worked on by a community memberopen for contributionsAn issue that is suitable for a community contributor (based on its complexity/scope).
Milestone
Description
Which @angular/* package(s) are the source of the bug?
Don't known / other
Is this a regression?
No
Description
The example for resetting a FormGroup that is given here does not match the typing of FormGroup.reset(). According to the typings, that {value: 'name', disabled: true} is invalid.
The typing of FormGroup.reset() should accept {value: T, disabled: boolean} for a FormControl because that is how the functionality works.
Please provide a link to a minimal reproduction of the bug
Please provide the exception or error you saw
Type '{ value: string; disabled: true; }' is not assignable to type 'string'.
Please provide the environment you discovered this bug in (run ng version)
Angular CLI: 17.3.2
Node: 20.9.0
Package Manager: npm 10.1.0
OS: win32 x64
Angular: 17.3.2
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, language-service, material, platform-browser
... platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1703.2
@angular-devkit/build-angular 17.3.2
@angular-devkit/core 17.3.2
@angular-devkit/schematics 17.3.2
@angular/fire 17.0.1
@schematics/angular 17.3.2
rxjs 7.8.1
typescript 5.4.3
zone.js 0.14.4
Anything else?
No response
Reacted by Kevin Thompson, David Snyder and Jrubzjeknf
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: docsRelated to the documentationarea: formsgood first issueLabel noting a good first issue to be worked on by a community memberopen for contributionsAn issue that is suitable for a community contributor (based on its complexity/scope).

Activity
yousefalaqra commentedon Apr 30, 2024
@JeanMeche Can i start be working on this issue?
TWGopaul commentedon May 2, 2024
This looks like a Typescript type error. In Typescript it is helpful to assign types to variables. For example the syntax goes like:
let name:string = ver.goWe're saying that a variable called
nameis a string and assigning it a value.The message is saying that
firstshould be a string and that you are trying to assign it a type of '{value:string, disabled:true}'.Notice how the format of
{value: 'name', disabled: true}matches the error message{value:string, disabled:true}.I'm having trouble getting the error message but I'd try the following:
form.reset({ form.first: {value: 'name', disabled: true}, form.last: 'last' });waw3ru commentedon May 17, 2024
It seems the docs are giving the wrong direction here. Because the type of
form.resetas per your example is:As you can see it goes through object provided and calls for each control the
resetmethod. TheAbstractControlreset type isMeaning the value you passed
disabled: trueseems to be read as part of theFormControlvalue instead of aFormControlmodifier.The best options is:
andres29diaz commentedon May 4, 2025
Hi, will this be part of some release? Because it's still happening :/
bougwal commentedon May 9, 2025
@vagostep fix(forms): allow control state as reset argument for FormGroup #55860
angular-automatic-lock-bot commentedon Oct 1, 2025
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.