This commit is contained in:
@@ -2,7 +2,7 @@ import { Component, Input, OnInit, OnDestroy } from '@angular/core';
|
||||
import { Router, RouterEvent, NavigationEnd } from '@angular/router';
|
||||
import { Subscription } from 'rxjs';
|
||||
|
||||
/**
|
||||
/**
|
||||
* Implements a responsive button for the toolbar
|
||||
* that consists of an icon, text and a link.
|
||||
* Optionally, it can be disabled and it is possible
|
||||
@@ -11,7 +11,7 @@ import { Subscription } from 'rxjs';
|
||||
* button will be flat.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'toolbar-button',
|
||||
selector: 'app-toolbar-button',
|
||||
templateUrl: './toolbar-button.component.html'
|
||||
})
|
||||
export class ToolbarButtonComponent implements OnInit, OnDestroy {
|
||||
@@ -53,7 +53,7 @@ export class ToolbarButtonComponent implements OnInit, OnDestroy {
|
||||
|
||||
/**
|
||||
* Creates a new button.
|
||||
*
|
||||
*
|
||||
* @param router The router.
|
||||
*/
|
||||
constructor(private router: Router) { }
|
||||
@@ -62,12 +62,12 @@ export class ToolbarButtonComponent implements OnInit, OnDestroy {
|
||||
this.routerSubscription = this.router.events.subscribe((event) => {
|
||||
if (event instanceof NavigationEnd) {
|
||||
this.updateVisibility();
|
||||
}
|
||||
}
|
||||
});
|
||||
this.updateVisibility();
|
||||
}
|
||||
|
||||
private updateVisibility():void {
|
||||
private updateVisibility(): void {
|
||||
this.visible = (this.router.url !== this.link);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user