I've got a feature that was just reported not working in internet explorer. No idea how long it's been not working, but I imagine it's been since the beginning. I can verify it in IE11.
My app is using angularjs 1.3.17.
There's a button on the form called reset
. When they click it, it calls vm.cancel()
, which looks like this:
function () {
vm.working = true;
vm.disableActions = true;
manualEntryApi.deleteWageAccounts(vm.selectedEnterprise.RecordID)
.success(
function (data, status, headers, config) {
vm.working = false;
vm.disableActions = false;
if (typeof (Storage) !== "undefined") {
localStorage.setItem("filename", "");
}
window.location.href("/FormEntry/#/ManualEntry/?ID="+vm.selectedEnterprise.RecordID);
})
.error(
function (data, status, headers, config) {
vm.working = false;
vm.disableActions = false;
vm.serverErrors = data;
vm.serverErrorMessage = "Error clearing records.";
vm.serverErrorMessage2 = "";
vm.openErrorModal = true;
});
});
It POSTs the recordID to an API, which does a bunch of stuff in the back end. It just returns a 200
whenever it succeeds.
After it succeeds, it writes an empty string to localStorage, and then it effectively does a page refresh. You can substitute the window.location.href
with window.location.reload()
since it's doing the same thing.
However, on the reload, it gives me the $digest
cycle error. I thought maybe it was something happening with the ng-init but I commented out the entire block of init code and it still errors. No idea what's going on.
Any idea why that would happen? I tried upgrading to angular 1.4.0, but as this is a legacy app that I inherited, there's a lot of spaghetti and lots of errors thrown by upgrading, so I'm hoping to get it to work in 1.3.17.
I know there are similar posts like this that usually ended up with the OP defining an array inside a for loop and getting this error due to it re-digesting every loop. But the only code I have executing on init right now is this:
vm.model = {};
vm.model.PaymentInfo = {};
vm.selectedEnterprise = $location.search();
vm.years = [];
vm.selectedEnterprise.RecordID = $routeParams.ID;
vm.EitOtherPageTotal = 0.0;
vm.LstOtherPageTotal = 0.0;
vm.WageOtherPageTotal = 0.0;
vm.pageNumber = 1;
vm.disableActions = false;
vm.working = false;
vm.openErrorModal = false;
vm.serverErrors = [];
vm.serverErrorMessage = "";
vm.serverErrorMessage2 = "";
vm.referenceName = "";
vm.fileID = null;
vm.sortOverride = null;
vm.validFilename = true;
vm.submitted = false;
Just some variable initializing.