35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import {Component, inject, signal} from '@angular/core';
|
|
import {NavigationEnd, Router, RouterOutlet} from '@angular/router';
|
|
import {TopNavigation} from './shared/navigation/top-navigation/top-navigation';
|
|
import {FeedbackButton} from 'sae-lib/buttons/feedback-button/feedback-button';
|
|
import {filter} from 'rxjs/operators';
|
|
import {Store} from '@ngrx/store';
|
|
import {StateInterface} from './redux/reducers';
|
|
|
|
// import {SaeLib} from '@sae-lib/src/public-api';
|
|
|
|
@Component({
|
|
selector: 'app-root',
|
|
imports: [RouterOutlet, TopNavigation, FeedbackButton],
|
|
templateUrl: './app.html',
|
|
styleUrl: './app.scss'
|
|
})
|
|
export class App {
|
|
public router = inject(Router);
|
|
currentUrl: string = '';
|
|
public appState: any = {};
|
|
protected readonly title = signal('implem');
|
|
|
|
constructor(private store: Store<StateInterface>) {
|
|
|
|
this.store.select(state => state.app).subscribe(appState => {
|
|
this.appState = appState;
|
|
});
|
|
this.router.events.pipe(
|
|
filter(event => event instanceof NavigationEnd)
|
|
).subscribe((event: any) => {
|
|
this.currentUrl = event.urlAfterRedirects;
|
|
console.log('Current URL:', this.currentUrl);
|
|
});
|
|
}
|
|
}
|