Petites évolutions
This commit is contained in:
@@ -14,7 +14,7 @@ import { User } from "../../models/user";
|
||||
})
|
||||
export class CreateUserComponent implements OnInit {
|
||||
createForm: FormGroup;
|
||||
loading = false;
|
||||
invalidForm = true;
|
||||
submitted = false;
|
||||
returnUrl: string;
|
||||
error = "";
|
||||
@@ -55,12 +55,12 @@ export class CreateUserComponent implements OnInit {
|
||||
}
|
||||
|
||||
onCreateSubmit() {
|
||||
this.loading = true;
|
||||
this.invalidForm = false;
|
||||
this.submitted = true;
|
||||
|
||||
// stop here if form is invalid
|
||||
if (this.createForm.invalid) {
|
||||
this.loading = true;
|
||||
this.invalidForm = true;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ export class CreateUserComponent implements OnInit {
|
||||
},
|
||||
error => {
|
||||
this.error = error;
|
||||
this.loading = false;
|
||||
this.invalidForm = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user