2022-03-15 10:15:06 +00:00
|
|
|
import { Component } from '@angular/core';
|
2022-03-15 20:45:41 +00:00
|
|
|
import { NavigationEnd, Router } from '@angular/router';
|
|
|
|
import { filter } from 'rxjs/operators';
|
2022-03-15 10:15:06 +00:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-root',
|
|
|
|
templateUrl: './app.component.html',
|
2022-03-15 20:45:41 +00:00
|
|
|
styleUrls: ['./app.component.scss'],
|
2022-03-15 10:15:06 +00:00
|
|
|
})
|
|
|
|
export class AppComponent {
|
2022-03-15 20:45:41 +00:00
|
|
|
/**
|
|
|
|
* Application title.
|
|
|
|
*/
|
2022-03-15 10:15:06 +00:00
|
|
|
title = 'Aktienbot';
|
2022-03-15 20:45:41 +00:00
|
|
|
showHeader = false;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Router import to show router-outlet.
|
|
|
|
*
|
|
|
|
* @param router Router
|
|
|
|
*/
|
|
|
|
constructor(private router: Router) {
|
|
|
|
this.router.events
|
|
|
|
.pipe(filter((event) => event instanceof NavigationEnd))
|
|
|
|
.subscribe((event) => {
|
|
|
|
this.showHeader = !(
|
|
|
|
(event as NavigationEnd).url === '/login' ||
|
|
|
|
(event as NavigationEnd).url === '/register'
|
|
|
|
);
|
|
|
|
});
|
|
|
|
}
|
2022-03-15 10:15:06 +00:00
|
|
|
}
|