From 4e736b198a7295bb9a228aee49056668a3dcc731 Mon Sep 17 00:00:00 2001 From: Zak Timson Date: Wed, 11 Jul 2018 21:28:43 -0400 Subject: [PATCH] Fixed geting cached data --- src/app/formulaManager/formulaManager.component.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/formulaManager/formulaManager.component.ts b/src/app/formulaManager/formulaManager.component.ts index a0f9912..b8120ad 100644 --- a/src/app/formulaManager/formulaManager.component.ts +++ b/src/app/formulaManager/formulaManager.component.ts @@ -29,7 +29,9 @@ export class FormulaManagerComponent { } displayFormula(formula) { - formula.components.forEach((row, i, arr) => row.component.get().then(row => (arr[i].component = row.data()))); + formula.components + .filter(row => typeof row.component.get == 'function') + .forEach((row, i, arr) => row.component.get().then(row => (arr[i].component = row.data()))); formula.total = formula.components.reduce((acc, row) => (acc += row.quantity), 0); this.newTotal = formula.total; this.formula = formula; @@ -49,7 +51,6 @@ export class FormulaManagerComponent { cost() { console.log( this.componentCosts.reduce((acc, row) => { - console.log(row.nativeElement.html); //acc + Number(new RegExp(/\$(\d+\.\d+)/).exec(row.nativeElement.innerHtml)[1]) return acc; }, 0)