<div data-bind="foreach: ccOpenInvoiceListObservable">
<div data-bind="foreach:Invoices">
<span data-bind="text:$root.formatCurrency(AmountOutstanding)"></span>
</div>
</div>
<div data-bind="foreach: overDueBalancesObservable">
<span data-bind="text: $parent.formatCurrency(OverDueAmount)"></span>
</div>
vm.formatCurrency = function (value) {
return "$" + value().toFixed(2);
};
I am getting the error mentioned in the subject line when trying to call $parent.formatCurrency(OverDueAmount). For AmountOutstanding, the values are getting formatted.