Skip to content

Commit 3aa6c40

Browse files
committed
fix: show current username
fix #3
1 parent 3ae2d37 commit 3aa6c40

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
<h1 *ngIf="authSvc.user$ | async">Welcome, user</h1>
2-
<p>home works!</p>
1+
<h1 *ngIf="(authSvc.user$ | async) as user">
2+
Welcome, {{ user?.username || 'User' }}.
3+
</h1>
4+
<p>home works!</p>

src/app/shared/models/user.interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export interface User {
55
password: string;
66
}
77

8-
export interface UserResponse {
8+
export interface UserResponse extends User {
99
message: string;
1010
token: string;
1111
userId: number;

0 commit comments

Comments
 (0)