Skip to content

FormGroup.reset() input typings are incorrect #55577

Open
@david-snyder-induro

Description

@david-snyder-induro

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.

image

Please provide a link to a minimal reproduction of the bug

https://replit.com/@david-snyder-in/Typing-Issues#src/app/app.component.ts

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: docsRelated to the documentationarea: formsgood first issueAn issue that is suitable for first-time contributors; often a documentation issue.help wantedAn issue that is suitable for a community contributor (based on its complexity/scope).

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions