Within my save function, I have the following:
$scope.saveData = function () {
if (confirm("Are you sure you want to save") === false) {
return
}
// do saving
When using the above code and clicking "yes," I encounter an error. Interestingly, even if I click "cancel," the same error appears in firebug. However, the data does get saved when I click "yes" despite the error persisting. This issue seems to be specific to Firefox as I do not experience it in Chrome.
If I remove the confirm dialog, the error disappears. This leads me to believe that the issue is related to the dialog box.
Error: [$rootScope:inprog] $apply already in progress http://errors.angularjs.org/1.2.25/$rootScope/inprog?p0=%24apply
Therefore, I thought perhaps I need to
e.preventDefault();
How can I incorporate this into the above function? Currently, I am utilizing it like this
ng-click="saveData()"