Début d'ajout d'une image pour les avions

This commit is contained in:
Sébastien André
2020-07-30 18:57:51 +02:00
parent eee6f596ac
commit 6c654d298d
8 changed files with 130 additions and 78 deletions

View File

@@ -1,20 +1,20 @@
import { Component, OnInit } from "@angular/core";
import { FormGroup, FormControl, Validators } from "@angular/forms";
import { AuthenticationService } from "../../services/authentication.service";
import { User } from "../../models/user";
import { Component, OnInit } from '@angular/core';
import { FormGroup, FormControl, Validators } from '@angular/forms';
import { AuthenticationService } from '../../services/authentication.service';
import { User } from '../../models/user';
@Component({
selector: "app-user-profile",
templateUrl: "./user-profile.component.html",
styleUrls: ["./user-profile.component.css"],
selector: 'app-user-profile',
templateUrl: './user-profile.component.html',
styleUrls: ['./user-profile.component.css'],
})
export class UserProfileComponent implements OnInit {
public userForm: FormGroup;
constructor(private authenticationService: AuthenticationService) {}
constructor(private authenticationService: AuthenticationService) { }
ngOnInit(): void {
let currentUser = this.authenticationService.currentUserValue;
const currentUser = this.authenticationService.currentUserValue;
this.userForm = new FormGroup(
{
@@ -32,15 +32,15 @@ export class UserProfileComponent implements OnInit {
Validators.email,
]),
currentPassword: new FormControl(
"",
Validators.pattern("^[A-Za-z0-9_-]{8,15}$")
'',
Validators.pattern('^[A-Za-z0-9_-]{8,15}$')
),
newPassword: new FormControl(
"",
Validators.pattern("^[A-Za-z0-9_-]{8,15}$")
'',
Validators.pattern('^[A-Za-z0-9_-]{8,15}$')
),
},
{ updateOn: "blur" }
{ updateOn: 'blur' }
);
}
@@ -49,7 +49,7 @@ export class UserProfileComponent implements OnInit {
return;
}
let updatedUser = new User();
const updatedUser = new User();
updatedUser.login = formData.username;
updatedUser.password = formData.password;
updatedUser.firstName = formData.firstname;