我正在使用angularjs-google-maps,並且在試圖將我的客戶作爲地圖上的標記進行循環播放時出現錯誤。
<map>
<custom-marker ng-repeat="cust in customers" position="[ {{ cust.lat }}, {{ cust.lon }} ]">
<div class="{{ cust.category }}">{{ cust.name }}</div>
</custom-marker>
</map>
的錯誤似乎有事情做與cust.category
和cust.name
,當我刪除這些,他們工作得很好。
這是錯誤消息我得到的第幾行:
Watchers fired in the last 5 iterations: [["[ cust.category , cust.name ]; newVal:
[\"pro\",\"Fred\"]; oldVal: [\"pro\",\"Fred\"]","fn: function (context) {\n
try {\n for(var i = 0, ii = length, part; i<ii; i++) {\n
完整的錯誤消息here。
任何與此有關的幫助表示讚賞。提前致謝!
UPDATE
代碼爲自定義標記指令,是角谷歌,地圖的部分here。
@realpha,請問您能否顯示您的數據?什麼是cust.category的數據類型? –
你可以設置你的問題的jsfiddle嗎? – jjbskir
@AbhilashPA'cust.category'是一個字符串,與'cust.name'一樣。兩者都存在於一個對象內。 – realph