Closed Vahanerevan closed 10 years ago
This is an issue for me too, have not found any solution yet though.
FOUND.
// in conrtroller
var cache = {};
var c;
$scope.getMarkerOptions = function(marker) {
if(!cache[marker.id]){
cache[marker.id] = $compile('<marker item="markers['+marker.id+']"></marker>')($scope);
}
c =cache[marker.id];
return {
shadow:'none',
content:c[0]
};
};
//directive
App.directive('marker', function() {
return {
scope:{
item:'='
},
restrict: 'E',
link: function(scope, element, attrs) {
// some code
},
templateUrl: 'some-html-file.html',
replace: true,
};
});
Hi is there a way to add richmarker as directive http://google-maps-utility-library-v3.googlecode.com/svn/trunk/richmarker/examples/richmarker.html ? Currently I use $interpolate service to create template and add html , but it needs to be updated every time I want to update content only.