Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

45 lignes
1.1 KiB

  1. import {AfterViewInit, Component, Input, OnInit} from '@angular/core';
  2. import {Subscription} from "rxjs";
  3. import {UserJsonld, UserService} from "@app/core/api/v1";
  4. import {AccountService} from "@app/_services";
  5. import {AppHelperService} from "@app/_helpers/app-helper.service";
  6. @Component({
  7. selector: 'app-users',
  8. templateUrl: './users.component.html',
  9. styleUrl: './users.component.scss'
  10. })
  11. export class UsersComponent implements OnInit, AfterViewInit {
  12. @Input() public user!: UserJsonld;
  13. constructor(
  14. private accountService: AccountService,
  15. private userService: UserService,
  16. protected appHelperService: AppHelperService
  17. ) {
  18. }
  19. ngOnInit() {
  20. }
  21. ngAfterViewInit(): void {
  22. this.getData();
  23. }
  24. getData() {
  25. const user = this.accountService.userValue;
  26. if (user?.id !== null && user?.id !== undefined) {
  27. this.userService.usersIdGet(
  28. this.appHelperService.extractId(user.id)
  29. ).subscribe(
  30. data => {
  31. this.user = data;
  32. }
  33. );
  34. }
  35. }
  36. }