Petites évolutions

This commit is contained in:
Sébastien André
2020-12-24 20:45:56 +01:00
parent cd4ac50cb1
commit c485d2d50d
5 changed files with 18 additions and 8 deletions

View File

@@ -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;
}
);
}