-
-
Save DuncanFaulkner/4e68338f2afccbaf8efe00c9cdf7ca66 to your computer and use it in GitHub Desktop.
daily component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit } from '@angular/core'; | |
import { Task } from '@app/shared/interfaces'; | |
import { Observable } from 'rxjs'; | |
import { AppFacadeService } from '@app/app-lib'; | |
@Component({ | |
templateUrl: './daily.component.html', | |
styleUrls: ['./daily.component.scss'], | |
}) | |
export class DailyComponent implements OnInit { | |
tasks$: Observable<Task[]>; | |
categories$: Observable<string[]>; | |
constructor(private appFacadeService: AppFacadeService) { | |
} | |
ngOnInit(): void { | |
this.tasks$ = this.appFacadeService.dailyTasks$; | |
this.categories$ = this.appFacadeService.dailyCategories$; | |
} | |
tasksTrackBy(task: Task, idx) { | |
return task.id; | |
} | |
onDelete(task: Task) { | |
this.appFacadeService.deleteTask(task); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment