import {ChangeDetectionStrategy, ChangeDetectorRef, Component} from "@angular/core";
import {NavigationStart, Router} from "@angular/router";

@Component({
  moduleId: module.id,
  selector: "app-header",
  templateUrl: "../../../../../src/resources/template/app/component/app_header.html",
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class AppHeaderComponent {
  public isLanding: boolean = false;

  constructor(protected router: Router,
              private cd: ChangeDetectorRef) {
    router.events.subscribe((event) => {
      if (event instanceof NavigationStart) {
        this.isLanding = event.url == '/home';
        this.cd.markForCheck();
      }
    })
  }
}
