You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
787 B
33 lines
787 B
|
4 years ago
|
import { Component, OnInit } from '@angular/core';
|
||
|
|
import { UiService} from '../../services/ui.service'
|
||
|
|
import {Subscription } from 'rxjs';
|
||
|
|
import { Router } from '@angular/router';
|
||
|
|
|
||
|
|
@Component({
|
||
|
|
selector: 'app-header',
|
||
|
|
templateUrl: './header.component.html',
|
||
|
|
styleUrls: ['./header.component.css']
|
||
|
|
})
|
||
|
|
export class HeaderComponent implements OnInit {
|
||
|
|
|
||
|
|
title: string = 'Task Tracker';
|
||
|
|
showAddTask:boolean = false;
|
||
|
|
subscription: Subscription;
|
||
|
|
|
||
|
|
constructor(private uiService:UiService, private router: Router) {
|
||
|
|
this.subscription = this.uiService.onToggle().subscribe(value => this.showAddTask = value);
|
||
|
|
}
|
||
|
|
|
||
|
|
ngOnInit(): void {
|
||
|
|
}
|
||
|
|
|
||
|
|
toggleAddTask() {
|
||
|
|
this.uiService.toggleAddTask();
|
||
|
|
}
|
||
|
|
|
||
|
|
hasRoute(route: string) {
|
||
|
|
return this.router.url == route;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|