Ajout de la traduction sur la page d'accueil
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { Router, ActivatedRoute } from "@angular/router";
|
||||
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
||||
import { TranslateService } from "@ngx-translate/core";
|
||||
|
||||
import { first } from "rxjs/operators";
|
||||
|
||||
@@ -19,12 +20,11 @@ export class CreateUserComponent implements OnInit {
|
||||
returnUrl: string;
|
||||
error = "";
|
||||
|
||||
constructor(
|
||||
private formBuilder: FormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private authenticationService: AuthenticationService
|
||||
) {
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private authenticationService: AuthenticationService,
|
||||
private translateService: TranslateService) {
|
||||
// redirect to home if already logged in
|
||||
if (this.authenticationService.currentUserValue) {
|
||||
this.router.navigate(["/"]);
|
||||
@@ -69,6 +69,7 @@ export class CreateUserComponent implements OnInit {
|
||||
createUser.firstName = this.formCtrls.firstname.value;
|
||||
createUser.lastName = this.formCtrls.lastname.value;
|
||||
createUser.email = this.formCtrls.email.value;
|
||||
createUser.language = this.translateService.currentLang;
|
||||
|
||||
this.authenticationService.create(createUser)
|
||||
.pipe(first())
|
||||
|
||||
Reference in New Issue
Block a user