Last active
September 5, 2020 04:08
-
-
Save gparlakov/cf16f8e81a3d0ee1fcf43336ac1b3877 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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