Angular: Ability to reset form

Created on 29 Nov 2016  路  6Comments  路  Source: angulardart/angular

TS implementation of ngForm directive has resetForm() method, but in Dart version looks like the only way to reset is to re-create it.

forms good first issue 鈿ew feature

Most helpful comment

Yup, still WIP.

I've added the ability to mark Controls as untouched / pristine. I'm working on added the ability to update the value for a ControlGroup/ControlArray. And then all the pieces are in place to add reset() method.

All 6 comments

Here is the updated reference to the TS implementation: https://github.com/angular/angular/blob/master/packages/forms/src/directives/ng_form.ts

cc @kwalrath

From the docs, to reset a form:

You have to clear all of the flags imperatively [...]

How can we do that? I don't find any ngControl API for marking a control as pristine.

@cedx That feature isn't currently available (which is what this issue is about). Until this issue is resolved, and to avoid further confusion, I'll be removing that section of the docs very soon.

@chalin Thanks for the clarification.

Ping @alorenzen is this still WIP?

Yup, still WIP.

I've added the ability to mark Controls as untouched / pristine. I'm working on added the ability to update the value for a ControlGroup/ControlArray. And then all the pieces are in place to add reset() method.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

matanlurey picture matanlurey  路  3Comments

matanlurey picture matanlurey  路  3Comments

Tomucha picture Tomucha  路  5Comments

matanlurey picture matanlurey  路  4Comments

ranquild picture ranquild  路  6Comments