2025-08-22 11:57:56 +02:00
|
|
|
import {Component, inject, signal} from '@angular/core';
|
2025-09-15 16:09:20 +02:00
|
|
|
import {NavigationEnd, Router, RouterOutlet} from '@angular/router';
|
2025-08-08 16:43:50 +02:00
|
|
|
import {TopNavigation} from './shared/navigation/top-navigation/top-navigation';
|
|
|
|
import {FeedbackButton} from 'sae-lib/buttons/feedback-button/feedback-button';
|
2025-08-22 11:57:56 +02:00
|
|
|
import {filter} from 'rxjs/operators';
|
2025-09-15 16:09:20 +02:00
|
|
|
import {Store} from '@ngrx/store';
|
|
|
|
import {StateInterface} from './redux/reducers';
|
2025-08-22 11:57:56 +02:00
|
|
|
|
2025-08-08 12:36:41 +02:00
|
|
|
// import {SaeLib} from '@sae-lib/src/public-api';
|
2025-08-07 14:24:23 +02:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-root',
|
2025-08-08 16:43:50 +02:00
|
|
|
imports: [RouterOutlet, TopNavigation, FeedbackButton],
|
2025-08-07 14:24:23 +02:00
|
|
|
templateUrl: './app.html',
|
|
|
|
styleUrl: './app.scss'
|
|
|
|
})
|
|
|
|
export class App {
|
2025-08-22 11:57:56 +02:00
|
|
|
public router = inject(Router);
|
|
|
|
currentUrl: string = '';
|
2025-09-15 16:09:20 +02:00
|
|
|
public appState: any = {};
|
2025-09-15 17:46:00 +02:00
|
|
|
public user: any = {};
|
2025-08-07 14:24:23 +02:00
|
|
|
protected readonly title = signal('implem');
|
2025-08-22 11:57:56 +02:00
|
|
|
|
2025-09-15 16:09:20 +02:00
|
|
|
constructor(private store: Store<StateInterface>) {
|
|
|
|
|
|
|
|
this.store.select(state => state.app).subscribe(appState => {
|
|
|
|
this.appState = appState;
|
|
|
|
});
|
2025-09-15 17:46:00 +02:00
|
|
|
this.store.select(state => state.user).subscribe(user => {
|
|
|
|
this.user = user;
|
|
|
|
});
|
2025-08-22 11:57:56 +02:00
|
|
|
this.router.events.pipe(
|
|
|
|
filter(event => event instanceof NavigationEnd)
|
|
|
|
).subscribe((event: any) => {
|
|
|
|
this.currentUrl = event.urlAfterRedirects;
|
|
|
|
console.log('Current URL:', this.currentUrl);
|
|
|
|
});
|
|
|
|
}
|
2025-08-07 14:24:23 +02:00
|
|
|
}
|