File tree Expand file tree Collapse file tree 1 file changed +21
-6
lines changed
Expand file tree Collapse file tree 1 file changed +21
-6
lines changed Original file line number Diff line number Diff line change 11< h2 > Add New Book</ h2 >
22< form [formGroup] ="form " (ngSubmit) ="onSubmit() ">
3- < input type ="text " formControlName ="title " /> < br />
4- < span [hidden] ="!form.get('title').hasError('required') "> Title is required</ span > < br />
5- < input type ="text " formControlName ="author " /> < br />
6- < span [hidden] ="!form.get('author').hasError('required') "> Author is required</ span > < br />
7- < button [disabled] ="!form.valid "> Save</ button >
8- </ form >
3+ < div class ="form-group row ">
4+ < label for ="isbn " class ="col-sm-2 col-form-label "> ISBN</ label >
5+ < input class ="form-control col-sm-10 " type ="text " formControlName ="isbn " />
6+ < small class ="col-sm-10 offset-sm-2 " [hidden] ="!form.get('isbn').hasError('required') "> ISBN is required</ small >
7+ < small class ="col-sm-10 offset-sm-2 " [hidden] ="!form.get('isbn').hasError('minlength') "> ISBN length should be 13</ small >
8+ < small class ="col-sm-10 offset-sm-2 " [hidden] ="!form.get('isbn').hasError('maxlength') "> ISBN length should be 13</ small >
9+ </ div >
10+ < div class ="form-group row ">
11+ < label for ="title " class ="col-sm-2 col-form-label "> Title</ label >
12+ < input type ="text " formControlName ="title " class ="form-control col-sm-10 " />
13+ < small class ="col-sm-10 offset-sm-2 " [hidden] ="!form.get('title').hasError('required') "> Title is required</ small >
14+ </ div >
15+ < div class ="form-group row ">
16+ < label for ="author " class ="col-sm-2 col-form-label "> Author</ label >
17+ < input class ="form-control col-sm-10 " type ="text " formControlName ="author " />
18+ < small class ="col-sm-10 offset-sm-2 " [hidden] ="!form.get('author').hasError('required') "> Author is required</ small >
19+ </ div >
20+ < div class ="row ">
21+ < button [disabled] ="!form.valid " type ="submit " class ="btn btn-success offset-sm-2 "> Create</ button >
22+ </ div >
23+ </ form >
You can’t perform that action at this time.
0 commit comments