angularjs - ui-gmap-window with directives and expressions -
i'm trying put html template in ui-gmap-window
. html contains directives such ng-click
, ng-repeat
not work.
<ui-gmap-google-map bounds="map.bounds" center="map.center" zoom="map.zoom" options="options"> <ui-gmap-window options="windowopt" show="windowopt.show" closeclick="closewindow"> <div class='map-popup'> <div><a ng-click='doit()' href='#'>action</a></div> <div ng-repeat="item in list"> {{item.content}} </div> </div> </ui-gmap-window> </ui-gmap-google-map>
or maybe need use way create carousel inside of ui-gmap-window
?
thanks
here sample: http://plnkr.co/edit/k8vvw3
googled around slightly, found this github issue.
to put shortly, use ng-repeat (or other angular directives) inside window, you'll need pass external window template , custom template parameters <ui-gmap-window>
follows:
index.html:
<ui-gmap-window options="windowopt" show="windowopt.show" closeclick="closewindow" templateurl="'windowcontent.html'" templateparameter="windowparams"> </ui-gmap-window>
script.js:
$scope.windowparams = { list: $scope.list, doit: function() { return $scope.doit() } }
windowcontent.html:
<div class='map-popup'> <div><a ng-click='parameter.doit()' href='#'>action</a></div> <div ng-repeat="item in parameter.list"> {{item.content}} </div> </div>
plunker demonstrate: http://plnkr.co/edit/mu8jfcjhwshbcghypdkr?p=preview
Comments
Post a Comment