1
I’m using the function pushState
to populate the history
, until then all right, but he at the time to use the windows.history.back()
can only return once. The function you add is the following:
function activate_page(sel, have_state)
{
var $dn = $(sel);
var is_vis = $dn.is(":visible");
if(!is_vis)
{
$dn.parents("body").find(".upage").addClass("hidden");
$dn.removeClass("hidden");
window.history.pushState({upage:sel}, sel, document.location.origin + document.location.pathname +sel);
$(document).trigger("pagechange");
}
}
And to return I use :
angular.module('ionic')
.run(function($ionicPlatform,$ionicPopup, $state,$ionicHistory){
$ionicPlatform.registerBackButtonAction(function (event) {
//console.log(window.history);
if($state.current.name=="app.listar_CELULAS"){
alert("entro aqui");
navigator.app.exitApp();
}
else {
window.history.back();
}
}, 100);
});
I need him to go all the way back to the top of the pile, the way he’s doing he only comes back one page.
Thank you from now on.
Here is a similar question with an answer: http://answall.com/questions/105371/window-history-back-voltando-apenas-umap%C3%A1gina
– leopiazzoli