MCPcopy Index your code
hub / github.com/angular/angular / onSubmit

Method onSubmit

packages/forms/src/directives/ng_form.ts:334–342  ·  view source on GitHub ↗

* @description * Method called when the "submit" event is triggered on the form. * Triggers the `ngSubmit` emitter to emit the "submit" event as its payload. * * @param $event The "submit" event object

($event: Event)

Source from the content-addressed store, hash-verified

332 * @param $event The "submit" event object
333 */
334 onSubmit($event: Event): boolean {
335 this.submittedReactive.set(true);
336 syncPendingControls(this.form, this._directives);
337 this.ngSubmit.emit($event);
338 this.form._events.next(new FormSubmittedEvent(this.control));
339 // Forms with `method="dialog"` have some special behavior
340 // that won't reload the page and that shouldn't be prevented.
341 return ($event?.target as HTMLFormElement | null)?.method === 'dialog';
342 }
343
344 /**
345 * @description

Callers 2

directives_spec.tsFile · 0.45

Calls 4

syncPendingControlsFunction · 0.90
setMethod · 0.65
emitMethod · 0.65
nextMethod · 0.45

Tested by

no test coverage detected