angular/aio/content/examples/template-syntax/src/app/hero-form.component.html
2017-03-28 10:21:46 +01:00

16 lines
457 B
HTML

<div id="heroForm">
<!-- #docregion -->
<form (ngSubmit)="onSubmit(heroForm)" #heroForm="ngForm">
<div class="form-group">
<label for="name">Name
<input class="form-control" name="name" required [(ngModel)]="hero.name">
</label>
</div>
<button type="submit" [disabled]="!heroForm.form.valid">Submit</button>
</form>
<div [hidden]="!heroForm.form.valid">
{{submitMessage}}
</div>
<!-- #enddocregion -->
</div>