我在一個涉及AngularJS的項目上工作,我正在運行一個錯誤似乎弄不清楚。不用說,我希望你們能幫我弄清楚這個問題,因爲我在這個問題上花了很長時間。AngularJS錯誤:TypeError:無法讀取未定義的屬性'toString'
這裏是我的代碼
WatchboxCtrl.js https://gist.github.com/anonymous/0c68fbd87574d61377b54981a09f66e5
,這是在錯誤發生
FleetMapCtrl.js
https://gist.github.com/anonymous/9df7bc7c54a09c91dd60cd009ba9ff91
歸根結底,我想做的是,讓應用程序顯示多個提醒,如果我點擊e的警報,應用程序應該自動放大發出警報的單位。以前,我有「id」作爲字符串,它工作正常;但是,後來我將「id」更改爲整數,縮放功能不再有效。在控制檯給了我這個錯誤我每次點擊警報:
angular.js:11655 TypeError: Cannot read property 'toString' of undefined at flyTo (FleetMapCtrl.js:320) at Object.fn (FleetMapCtrl.js:287) at Scope.$digest (angular.js:14308) at Scope.$apply (angular.js:14571) at HTMLButtonElement.<anonymous> (angular.js:21571) at HTMLButtonElement.dispatch (jquery-2.0.3.min.js:5) at HTMLButtonElement.y.handle (jquery-2.0.3.min.js:5)
它顯示錯誤在fleetmapCtrl.js線320,但我無法弄清楚/明白爲什麼它不工作。
請幫忙。我到處搜索,以解決它,但我似乎無法解決它。我很絕望。謝謝