docs(forms): ngSubmit is an output property of NgForm directive (#3056)
incorporates and closes PR #3040
This commit is contained in:
parent
9e02eddac5
commit
f302146ccd
|
@ -575,8 +575,8 @@ figure.image-display
|
|||
trigger a form submit because of its type (`type="submit"`).
|
||||
|
||||
A "form submit" is useless at the moment.
|
||||
To make it useful, we'll update the `<form>` tag with another Angular directive, `NgSubmit`,
|
||||
and bind it to the `HeroFormComponent.submit()` method with an event binding
|
||||
To make it useful, bind the `NgForm` directive's `ngSubmit` event property (in the `<form>` tag)
|
||||
to the `HeroFormComponent.submit()` method:
|
||||
+makeExample('forms/ts/app/hero-form.component.html', 'ngSubmit')(format=".")
|
||||
|
||||
:marked
|
||||
|
@ -671,7 +671,7 @@ figure.image-display
|
|||
|
||||
- An Angular HTML form template.
|
||||
- A form component class with a `Component` decorator.
|
||||
- The `ngSubmit` directive for handling the form submission.
|
||||
- Handling form submission by binding to the `NgForm.ngSubmit` event property.
|
||||
- Template reference variables such as `#heroForm`, `#name` and `#power`.
|
||||
- The `[(ngModel)]` syntax and a `name` attribute for two-way data binding, validation and change tracking.
|
||||
- The reference variable’s `valid` property on input controls to check if a control is valid and show/hide error messages.
|
||||
|
|
Loading…
Reference in New Issue