Ajout Login et Register #14
Merged
clement.freville2
merged 11 commits from form-login-register
into master
5 months ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'form-login-register'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Do not commit a
.nx
directory.export class LoginComponent {
hide = true;
email = new FormControl('', [Validators.required, Validators.email]);
This field is never used in the login template.
Si je l'utilise pour afficher ou non le mot de passe
.subscribe(() => this.updateErrorMessage());
}
updateErrorMessage() {
Validators must only exist in
FormControl
, do not try to duplicate this behavior.<div class="form-container">
https://angular.dev/guide/forms/reactive-forms
mat-flat-button
color="primary"
(click)="register()"
[disabled]="email.invalid || login.invalid || password.invalid">
login = new FormControl('', [Validators.required]);
password = new FormControl('', [Validators.required]);
export class UserService {
API_URL = 'http://127.0.0.1:3000';
private Users: User[] = [];
getUsers(): Observable<any> {
return this.http.get(`${this.API_URL}/Users`);
}
permissions: 0,
};
return this.http.post<any>(`${this.API_URL}/users`, body);
No permissions should appear here, or your application would not be very secure.
};
return this.http.post<any>(`${this.API_URL}/users/login`, body);
}
Never take
NgForm
in a service.}
html, body { height: 100%; }
body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; }
It is the same style as above...
80c0d99bee
into master 5 months agoReviewers
80c0d99bee
.