Ajout de style
This commit is contained in:
@@ -32,22 +32,25 @@ export class CreateUserComponent implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.createForm = this.formBuilder.group({
|
||||
username: ["", [Validators.required, Validators.minLength(3)]],
|
||||
password: [
|
||||
"",
|
||||
[Validators.required, Validators.pattern("^[A-Za-z0-9_-]{8,15}$")]
|
||||
],
|
||||
firstname: ["", [Validators.required, Validators.minLength(3)]],
|
||||
lastname: ["", [Validators.required, Validators.minLength(3)]],
|
||||
email: ["", [Validators.required, Validators.email]]
|
||||
});
|
||||
this.createForm = this.formBuilder.group(
|
||||
{
|
||||
username: ["", [Validators.required, Validators.minLength(3)]],
|
||||
password: [
|
||||
"",
|
||||
[Validators.required, Validators.pattern("^[A-Za-z0-9_-]{8,15}$")]
|
||||
],
|
||||
firstname: ["", [Validators.required, Validators.minLength(3)]],
|
||||
lastname: ["", [Validators.required, Validators.minLength(3)]],
|
||||
email: ["", [Validators.required, Validators.email]]
|
||||
},
|
||||
{ updateOn: "submit" }
|
||||
);
|
||||
|
||||
// get return url from route parameters or default to '/'
|
||||
this.returnUrl = this.route.snapshot.queryParams["returnUrl"] || "/";
|
||||
}
|
||||
|
||||
get createCtrls() {
|
||||
get formCtrls() {
|
||||
return this.createForm.controls;
|
||||
}
|
||||
|
||||
@@ -62,11 +65,11 @@ export class CreateUserComponent implements OnInit {
|
||||
}
|
||||
|
||||
let createUser = new User();
|
||||
createUser.login = this.createCtrls.username.value;
|
||||
createUser.password = this.createCtrls.password.value;
|
||||
createUser.firstName = this.createCtrls.firstname.value;
|
||||
createUser.lastName = this.createCtrls.lastname.value;
|
||||
createUser.email = this.createCtrls.email.value;
|
||||
createUser.login = this.formCtrls.username.value;
|
||||
createUser.password = this.formCtrls.password.value;
|
||||
createUser.firstName = this.formCtrls.firstname.value;
|
||||
createUser.lastName = this.formCtrls.lastname.value;
|
||||
createUser.email = this.formCtrls.email.value;
|
||||
|
||||
this.authenticationService
|
||||
.create(createUser)
|
||||
|
||||
Reference in New Issue
Block a user