Fix compilation errors

This commit is contained in:
William Brawner 2018-08-29 21:29:45 -05:00
parent 5302e11905
commit f8b33cb67e
2 changed files with 4 additions and 3 deletions

View file

@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { Transaction } from '../transaction'
import { TransactionService } from '../transaction.service' import { TransactionService } from '../transaction.service'
@Component({ @Component({
@ -25,6 +26,6 @@ export class DashboardComponent implements OnInit {
} }
getTransactions(): void { getTransactions(): void {
this.transactionService.getTransactions().subscribe(transactions => this.balance = balance) this.transactionService.getTransactions().subscribe(transactions => this.transactions = transactions)
} }
} }

View file

@ -15,7 +15,7 @@ export class TransactionService {
this.db = new BudgetDatabase(); this.db = new BudgetDatabase();
} }
getTransactions(count: number?): Observable<Transaction[]> { getTransactions(count?: number): Observable<Transaction[]> {
if (count) { if (count) {
return from(this.db.transactions.toCollection().limit(count).toArray()) return from(this.db.transactions.toCollection().limit(count).toArray())
} else { } else {
@ -41,7 +41,7 @@ export class TransactionService {
return from(this.db.transactions.delete(transaction.id)) return from(this.db.transactions.delete(transaction.id))
} }
getBalance(): Observable<number { getBalance(): Observable<number> {
console.log("Getting balance") console.log("Getting balance")
let sum = 0; let sum = 0;
return from( return from(