Skip to content

Instantly share code, notes, and snippets.

@DuncanFaulkner
Created March 31, 2021 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DuncanFaulkner/4e68338f2afccbaf8efe00c9cdf7ca66 to your computer and use it in GitHub Desktop.
Save DuncanFaulkner/4e68338f2afccbaf8efe00c9cdf7ca66 to your computer and use it in GitHub Desktop.
daily component
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