Skip to content

Commit 730d688

Browse files
committed
style(book-edit): add bootstrap styles
1 parent eb730af commit 730d688

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed
Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
<h2>Edit</h2>
22
<div *ngIf="book">
33
<form #form="ngForm" (ngSubmit)="onSubmit(form.value)">
4-
<input type="text" name="isbn" #isbn="ngModel" [(ngModel)]="book.isbn" required/><br />
5-
<span [hidden]="!isbn.errors?.required">ISBN is required</span><br />
6-
<input type="text" name="title" #title="ngModel" [(ngModel)]="book.title" required/><br />
7-
<span [hidden]="!title.errors?.required">Title is required</span><br />
8-
<input type="text" name="author" #author="ngModel" [(ngModel)]="book.author" required/><br />
9-
<span [hidden]="!author.errors?.required">Author is required</span><br />
10-
<button [disabled]="!form.valid" type="submit">Save</button>
4+
<div class="form-group row">
5+
<label for="isbn" class="col-sm-2 col-form-label">ISBN</label>
6+
<input class="form-control col-sm-10" type="text" name="isbn" #isbn="ngModel" [(ngModel)]="book.isbn" readonly/>
7+
</div>
8+
<div class="form-group row">
9+
<label for="title" class="col-sm-2 col-form-label">Title</label>
10+
<input type="text" name="title" #title="ngModel" [(ngModel)]="book.title" required class="form-control col-sm-10"/>
11+
<small class="col-sm-10 offset-sm-2" [hidden]="!title.errors?.required">Title is required</small>
12+
</div>
13+
<div class="form-group row">
14+
<label for="author" class="col-sm-2 col-form-label">Author</label>
15+
<input class="form-control col-sm-10" type="text" name="author" #author="ngModel" [(ngModel)]="book.author" required/>
16+
<small class="col-sm-10 offset-sm-2" [hidden]="!author.errors?.required">Author is required</small>
17+
</div>
18+
<div class="row">
19+
<button [disabled]="!form.valid" type="submit" class="btn btn-success offset-sm-2">Save</button>
20+
<button [routerLink]="['/books', book.isbn]" class="btn btn-warning">Cancel</button>
21+
</div>
1122
</form>
1223
</div>

0 commit comments

Comments
 (0)