I am trying to handle some errors such as no network connectivity or no server response. I am able to trap error and can get the following code section to execute, I cannot figure out how to stop the loading icon that is displaying while hitting a remote datasource that still shows over my error message view.
I have searched for loading and loader and cannot see in my code where I even defined what the icon should be. I have also searched the web for a solution however I have not found anything that works. Note, I have cloned this project from a backend services project, but have changed the datasource to connect to my own API. I have attached image showing the loader icon, since it may give a clue as to where it is shown or hidden.
Thanks in advance for your quick help in this matter.
01.
error:
function
(e) {
02.
e.preventDefault();
03.
//app.mobileApp.loader.hide(); GIVES AN ERROR of cannot read property of 'hide' of undefined
04.
alert(
"Status: "
+ e.status +
"; Error message: "
+ e.errorThrown);
05.
if
(e.errorThrown ==
"Unauthorized"
) {
06.
app.mobileApp.navigate(
"components/authSettingsView/view.html"
);
07.
}
08.
if
(e.errorThrown ==
"Forbidden"
) {
09.
app.mobileApp.navigate(
"components/authSettingsView/view.html"
);
10.
}
11.
app.mobileApp.navigate(
"#errorpage"
);
12.
},