我有一個NG-重複打印出的圖列表AngularJs - 在工具提示應用範圍函數變量時奇怪的錯誤
<td ng-repeat="field in objectKeys(estimate)" ng-init="amount = estimate[key]">
<a href="#"
editable-text="estimate[field]"
onaftersave="updateFigure(field,value[field], estimate)"
tooltip="${{formatNumber(actualTable[account][field])}}"
tooltip-trigger="mouseenter"
tooltip-placement="left">
{{formatNumber(estimate[field])}}
</a>
</td>
的好處是,它完美的作品即打印估計用工具提示顯示實際金額。
但是,由於變量actualTable[account][field]
爲空,控制檯不斷報告錯誤,稱此{{formatNumber(actualTable[account][field])}}
函數調用有問題。但它不爲空,否則無法正確打印。
錯誤的截圖是
我還必須補充一點,實際的表數據是通過異步HTTP調用單獨要求評估表。
我該如何解決這個問題?
是否'actualTable'通過Ajax填充添加
undefined
檢查? – Reza通過anm asycn http呼叫是 – nogias