templateParameter not updating
I am using build angular-google-maps 1.0.17 2014-03-30 and have various markers displayed on the map in the following way:
<markers models='components' coords="'self'" doCluster='true' click="'getDetails'"> </markers>
Im then using the window component to show details for the selected marker:
<window coords="windowCoords" show="displayWindow" templateUrl="'views/info-window.html'" templateParameter="componentDetails"> </window>
getDetails() is triggered when a marker is selected, returning the correct data for the selected marker.
However, once I set $scope.componentDetails = newData I'm still getting the old window details, and the info window is not rendering with the updated data. It does appear to be picking up the new coords as the window displays in the correct location, but with stale data.
Anyone ever run into something similar or am I implementing this wrong?
If I get time this week, I'll look into it. Otherwise it will have to wait till Sat, or Sunday.
I was able to solve this simply by setting show to false first in my getDetails(). Whereas before I was setting it to true every time.
Because show was true every time on getDetails(), the watch function that is listening for the change in show would not be detected .
:+1:
This was helpful to read about, as I was having the same issue. For others coming to this issue in the future, consider modifying any property that's tied to the ui-gmap-window's options parameter, and that'll get the templateParameter changes to also be appreciated.
In my case, I set a new placeholder property windowOptions.modelId = <the_new_model's_id> upon every click, just for the sake of triggering the watcher.