Skip to content

Instantly share code, notes, and snippets.

@gparlakov
Last active September 5, 2020 04:08
Show Gist options
  • Select an option

  • Save gparlakov/cf16f8e81a3d0ee1fcf43336ac1b3877 to your computer and use it in GitHub Desktop.

Select an option

Save gparlakov/cf16f8e81a3d0ee1fcf43336ac1b3877 to your computer and use it in GitHub Desktop.
class BillPaymentComponent {
bills$: Observable<BillRow[]>;
loading$: Observable<boolean>;
selected: BillRow[] = [];
constructor(page: BillPaymentPage) {}
ngOnInit() {
this.page.onPageEnter();
this.bills$ = this.page.bills$;
this.loading$ = this.page.loading$;
}
ngOnDestroy() {
this.page.onPageLeave();
}
onBillRowSelect(b: BillRow) {
this.selected = this.selected.includes(b) ? this.selected.filter((s) => s != b) : [...this.selected, b];
}
onPayButton() {
this.page.pay(this.selected);
}
onPayConfirm() {
this.page.payConfirm();
}
onPayCancel() {
this.page.payCancel();
}
onHideButton() {
this.page.hide(this.selecetd);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment