mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
21 lines
526 B
HTML
21 lines
526 B
HTML
<div id="heroForm">
|
|
<!-- #docregion -->
|
|
<form (ngSubmit)="onSubmit(heroForm)" #heroForm="ngForm">
|
|
<div class="form-group">
|
|
<label for="name">Name</label>
|
|
<input
|
|
type="text"
|
|
id="name"
|
|
class="form-control"
|
|
name="name"
|
|
required
|
|
[(ngModel)]="hero.name"
|
|
/>
|
|
</div>
|
|
<button type="submit" [disabled]="!heroForm.form.valid">Submit</button>
|
|
</form>
|
|
<div [hidden]="!heroForm.form.valid">
|
|
{{submitMessage}}
|
|
</div>
|
|
<!-- #enddocregion -->
|
|
</div>
|