File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 55 < label for ="name ">
66 Nom de l'appareil
77 </ label >
8- < input type ="text " id ="name " class ="form-control " name ="name " ngModel >
8+ < input type ="text " id ="name " class ="form-control " name ="name " ngModel required >
99 </ div >
1010 < div class ="form-group ">
1111 < label for ="status ">
1212 État de l'appareil
1313 </ label >
14- < select id ="status " class ="form-control " name ="status " ngModel >
14+ < select id ="status " class ="form-control " name ="status " [ ngModel] =" defaultOnOff " >
1515 < option value ="allumé "> Allumé</ option >
1616 < option value ="éteint "> Éteint</ option >
1717 </ select >
1818 </ div >
19- < button class ="btn btn-primary " type ="submit "> Enregistrer</ button >
19+ < button class ="btn btn-primary " type ="submit " [disabled] =" f.invalid " > Enregistrer</ button >
2020 </ form >
2121 </ div >
2222</ div >
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ import { NgForm } from '@angular/forms';
88} )
99export class EditAppareilComponent implements OnInit {
1010
11+ defaultOnOff = 'éteint' ;
12+
1113 constructor ( ) { }
1214
1315 ngOnInit ( ) : void {
You can’t perform that action at this time.
0 commit comments