I'm using angularjs-google-maps and am getting an error when trying to loop over my customers as markers on a map.
<map>
<custom-marker ng-repeat="cust in customers" position="[ {{ cust.lat }}, {{ cust.lon }} ]">
<div class="{{ cust.category }}">{{ cust.name }}</div>
</custom-marker>
</map>
The error seems to have something to do with cust.category
and cust.name
, as when I remove these they work fine.
This is the first couple lines of the error message I'm getting:
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
Full error message here.
Any help with this is appreciated. Thanks in advance!
UPDATE
Code for the custom-marker directive that's part of angular-google-maps is here.
It seems like the digest cycle is stuck in a loop. Angular has a digest cycle where they watch models (whatever is on $scope) and apply changes to the views if the models change. If in a digest cycle you're executing some function that changes a value again, you're triggering another digest cycle which triggers that same function again, changes a value on the model and triggers an infinite loop of digest cycles.
That said, you might want to add the code for your customMarker directive for answers to be more precise.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With