In the end, if anyone is interested, I fixed it like this:
In purchase1.js, I added this to the submit () function:
$rootscope.demographic=1;
In purchase2.js, I added this code to the controller:
var init = function(){ if(angular.isUndefined($rootScope.demographic)){ $location.path('/purchase1'); } }; init();
It works because Refresh (F5) completely restarts the application, therefore it also resets the root $ directory and makes it "Demographic" Undefined.
After entering purchase2, the "init" function will start, if we came from purchase1, everything will be fine, and demographics will be determined, otherwise we will just load purchase1 again.
:)
source share