File tree Expand file tree Collapse file tree 1 file changed +18
-7
lines changed
Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change 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 >
You can’t perform that action at this time.
0 commit comments