diff --git a/src/app/modules/profile/profile-info/profile-info.component.html b/src/app/modules/profile/profile-info/profile-info.component.html index 09eb0583dbeb9f5f4ecf0e45918bd5a0773ca934..f81beeefafc689a2842279fdf6c4de73f475c41b 100644 --- a/src/app/modules/profile/profile-info/profile-info.component.html +++ b/src/app/modules/profile/profile-info/profile-info.component.html @@ -12,7 +12,7 @@ src="https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_1280.png" alt="profile picture" /> - <h3>User Name</h3> + <h3>{{ username }}</h3> </div> <hr /> <div class="profile_stats"> diff --git a/src/app/modules/profile/profile-info/profile-info.component.ts b/src/app/modules/profile/profile-info/profile-info.component.ts index f534187c237dd03feee95149b686e875b7ac7ae9..0081079c2ef05563c45db29717e53f31f6e2e03e 100644 --- a/src/app/modules/profile/profile-info/profile-info.component.ts +++ b/src/app/modules/profile/profile-info/profile-info.component.ts @@ -11,6 +11,7 @@ import { UserService } from '../../../services/user.service'; export class ProfileInfoComponent implements OnInit { quizList: any[] = []; isLogged: boolean = false; + username: string = 'Anonymous'; constructor(private router: Router, private cookieService: CookieService, private userSerivce: UserService) {} ngOnInit(): void { @@ -31,8 +32,9 @@ export class ProfileInfoComponent implements OnInit { { title: 'Quiz 14', content: 'Quiz 14 Content' }, { title: 'Quiz 15', content: 'Quiz 15 Content' }, ]; - this.userSerivce.getMe().subscribe((data) => { + this.userSerivce.getMe().subscribe((data: any) => { this.isLogged = true; + this.username = data.username; }); }