I have the following AngularJS function called editlocation that opens a Modal window that I can edit three pieces of data.
After the result I want to be able to run plotmarkers this is used in another instance of an ng-click. I have tried the following but it doesn't work. I also tried placing it inside the ModalInstanceCtrl2 controller too, but no luck.
$scope.editlocation = function (locations) {
var locationToEdit = locations;
var modalInstance = $modal.open({
templateUrl: 'template/modal-edit-marker.html',
controller: ModalInstanceCtrl2,
resolve: {
locations: function () {
return locationToEdit;
}
},
scope: $scope.$new()
});
modalInstance.result.then(function (selectedItem) {
locationToEdit.title = selectedItem.title;
locationToEdit.gps = selectedItem.gps;
locationToEdit.desc = selectedItem.desc;
$scope.plotmarkers;
}, function () {
console.log('Modal dismissed at: ' + new Date());
});
};
$scope.plotmarkers = function() {
//things will happen here
};