angular/aio/content/examples/template-syntax/src/app/hero-form.component.html
2021-10-08 20:39:11 +00:00

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>