Skip to content

Instantly share code, notes, and snippets.

@andrewarosario
Last active February 8, 2020 17:57
Show Gist options
  • Save andrewarosario/1559250c73a7af84c7c9110332c0ab17 to your computer and use it in GitHub Desktop.
Save andrewarosario/1559250c73a7af84c7c9110332c0ab17 to your computer and use it in GitHub Desktop.
@Component({
selector: 'categories',
templateUrl: './categories.component.html',
styleUrls: ['./categories.component.scss']
})
export class CategoriesComponent implements OnInit {
@Input() cashflowCategories$: CashflowCategory[];
newCategory: CashflowCategory = new CashflowCategory();
isUpdating$: Observable<boolean>;
constructor(private settingsFacade: SettingsFacade) {
this.isUpdating$ = settingsFacade.isUpdating$;
}
ngOnInit() {
this.settingsFacade.loadCashflowCategories();
}
addCategory(category: CashflowCategory) {
this.settingsFacade.addCashflowCategory(category);
}
updateCategory(category: CashflowCategory) {
this.settingsFacade.updateCashflowCategory(category);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment