After creating a map and connecting it with my geojson api, I encountered an issue when trying to link each marker popup with ng-click. Simply adding HTML like this did not work as expected:
layer.bindPopup("<button ng-click='()'>+feature.properties.title+</button>");
This problem led me to create the following code snippet. Unfortunately, I received an error message stating "Error: [ng:areq] Argument 'scope' is required."
$http.get("http://markers.json").success(function(data, status) {
angular.extend($scope, {
geojson: {
data: data,
onEachFeature: function(feature, layer, scope) {
var template = "<button class='button button-clear button-royal' ng-click='aa()')>" +feature.properties.title +"</button>";
var linkFn = $compile(template);
var content = linkFn(scope);
layer.bindPopup(content);
},
}
});
});
As a newcomer to Angular and JavaScript, I believe there might be something obvious or silly causing this issue. Any assistance would be greatly appreciated. Thank you!