I think that there are a bug regarding the navigate to or similar.
from the beginning I wanted to do some checks in the init method of index page and then redirect to another page than the default page set for the app.
Even though all code was in the init method it didn't run in sequence as I have tried to explain above
Now I have moved some code from index-init to the success section in the method that calls the rest service and after the rest-call, I have the navigate to - expression.
What happens is that the navigate-to is executed before the console.log message n this snippet
// METHOD isCheckedIn in index which calls the REST service
...
// Success section of the REST call in isCheckedIn
$scope.isCheckedIn = isCheckedIn_scope;
console.log("Index:ischeckedin - after db access =" + isCheckedIn_scope);
Code: Select all
$scope.setCheckInStatus(isCheckedIn_scope); // METHOD IN INDEX
if(isCheckedIn_scope) {
Apperyio.navigateTo("Activities", {});
}
...
From the log which shows that for some reason the functions in activities is run before the functions in index even though the calls comes after those
[Log] activities::init - inside if (ActivitiesController.js, line 23)
[Log] Activitis::getAllSessionsByArea (ActivitiesController.js, line 33)
[Log] Index:ischeckedin - after db access =true (indexController.js, line 65)
[Log] Index::setCheckInStatus (indexController.js, line 180)