MCPcopy Create free account
hub / github.com/angular/components / reset

Method reset

src/cdk/stepper/stepper.ts:275–293  ·  view source on GitHub ↗

Resets the step to its initial state. Note that this includes resetting form data.

()

Source from the content-addressed store, hash-verified

273
274 /** Resets the step to its initial state. Note that this includes resetting form data. */
275 reset(): void {
276 this._interacted.set(false);
277
278 if (this._completedOverride() != null) {
279 this._completedOverride.set(false);
280 }
281
282 if (this._customError() != null) {
283 this._customError.set(false);
284 }
285
286 if (this.stepControl) {
287 // Reset the forms since the default error state matchers will show errors on submit and we
288 // want the form to be back to its initial state (see #29781). Submitted state is on the
289 // individual directives, rather than the control, so we need to reset them ourselves.
290 this._childForms?.forEach(form => form.resetForm?.());
291 reset(this.stepControl);
292 }
293 }
294
295 ngOnChanges() {
296 // Since basically all inputs of the MatStep get proxied through the view down to the

Callers

nothing calls this directly

Calls 2

resetFunction · 0.85
setMethod · 0.80

Tested by

no test coverage detected