Created
September 14, 2019 19:19
-
-
Save dileno/c30e68c2af8ad73cf4dc2e11313829c1 to your computer and use it in GitHub Desktop.
Blog-post-add-edit.component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>{{actionType}} blog post</h1> | |
<form [formGroup]="form" (ngSubmit)="save()" #formDir="ngForm" novalidate> | |
<div class="form-group row"> | |
<label class=" control-label col-md-12">Title</label> | |
<div class="col-md-12"> | |
<input class="form-control" type="text" formControlName="title"> | |
</div> | |
<span class="text-danger ml-3" *ngIf="title.invalid && formDir.submitted"> | |
Title is required. | |
</span> | |
</div> | |
<div class="form-group row"> | |
<label class="control-label col-md-12" for="Body">Body text</label> | |
<div class="col-md-12"> | |
<textarea class="form-control" rows="15" formControlName="body"></textarea> | |
</div> | |
<span class="text-danger ml-3" *ngIf="body.invalid && formDir.submitted"> | |
Body is required. | |
</span> | |
</div> | |
<div class="form-group"> | |
<button type="submit" class="btn btn-success float-right">Save</button> | |
<button class="btn btn-secondary float-left" (click)="cancel()">Cancel</button> | |
</div> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment