chore(deps): upgrade Angular 18 → 19
- ng update @angular/core@19 @angular/cli@19 @angular/material@19 @angular-eslint/schematics@19 - Migration: remove standalone:true (now default in v19) from 60 components - Migration: zone.js 0.14 → 0.15 - Fix pre-existing build budget error: raise initial bundle limit to 5mb (app ships large static JSON assets)
This commit is contained in:
@@ -6,7 +6,7 @@ import { MatDividerModule } from '@angular/material/divider';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { MatToolbarModule } from '@angular/material/toolbar';
|
||||
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
import { Observable, Subscription } from 'rxjs';
|
||||
|
||||
import { User } from '@models';
|
||||
@@ -15,15 +15,17 @@ import { UserService } from '@services';
|
||||
@Component({
|
||||
selector: 'app-layout-header',
|
||||
templateUrl: './header.component.html',
|
||||
standalone: true,
|
||||
imports: [
|
||||
RouterLink, RouterLinkActive,
|
||||
MatToolbarModule, MatButtonModule, MatDividerModule,
|
||||
MatIconModule, MatMenuModule
|
||||
]
|
||||
RouterLink,
|
||||
RouterLinkActive,
|
||||
MatToolbarModule,
|
||||
MatButtonModule,
|
||||
MatDividerModule,
|
||||
MatIconModule,
|
||||
MatMenuModule,
|
||||
],
|
||||
})
|
||||
export class HeaderComponent implements OnInit {
|
||||
|
||||
private _currentUser: Subscription = new Subscription();
|
||||
private _isAuthenticated: Subscription = new Subscription();
|
||||
private isAuthenticated = false;
|
||||
@@ -32,22 +34,18 @@ export class HeaderComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private userService: UserService
|
||||
) { }
|
||||
private userService: UserService,
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
const user$: Observable<User> = this.userService.currentUser.pipe(takeUntilDestroyed(this.destroyRef));
|
||||
this._currentUser = user$.subscribe(
|
||||
(userData) => {
|
||||
this.currentUser = userData;
|
||||
}
|
||||
);
|
||||
this._currentUser = user$.subscribe((userData) => {
|
||||
this.currentUser = userData;
|
||||
});
|
||||
const auth$: Observable<boolean> = this.userService.isAuthenticated.pipe(takeUntilDestroyed(this.destroyRef));
|
||||
this._isAuthenticated = auth$.subscribe(
|
||||
(value) => {
|
||||
this.isAuthenticated = value;
|
||||
}
|
||||
);
|
||||
this._isAuthenticated = auth$.subscribe((value) => {
|
||||
this.isAuthenticated = value;
|
||||
});
|
||||
}
|
||||
|
||||
goToGitHub() {
|
||||
|
||||
Reference in New Issue
Block a user