ng-implementation/sae-csc/src/app/app.ts

29 lines
925 B
TypeScript
Raw Normal View History

2025-08-22 11:57:56 +02:00
import {Component, inject, signal} from '@angular/core';
import {ActivatedRoute, Router, RouterOutlet, NavigationEnd} 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';
// 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-08-07 14:24:23 +02:00
protected readonly title = signal('implem');
2025-08-22 11:57:56 +02:00
constructor() {
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
}