Skip to content

Commit 0211854

Browse files
author
Simon
committed
updated account.store.ts & mobx-reaction.directive.ts
1 parent 15b4053 commit 0211854

13 files changed

Lines changed: 185 additions & 500 deletions
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<button mat-raised-button (click)="deposit()">deposit</button>
2+
<button mat-raised-button (click)="withdraw()">withdraw</button>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
button {
2+
width: 152px;
3+
margin-right: 20px;
4+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Component, OnInit } from '@angular/core';
2+
import { Account } from '../stores/account.store';
3+
4+
@Component({
5+
selector: 'app-actions',
6+
templateUrl: './actions.component.html',
7+
styleUrls: ['./actions.component.scss']
8+
})
9+
export class ActionsComponent implements OnInit {
10+
constructor(private account: Account) {}
11+
12+
deposit() {
13+
this.account.deposit(parseInt(window.prompt('select amount'), 10));
14+
}
15+
withdraw() {
16+
this.account.withdraw(parseInt(window.prompt('select amount'), 10));
17+
}
18+
ngOnInit() {}
19+
}

0 commit comments

Comments
 (0)