javascript - Any alternative to window.history.back() as it repeats the visited page every time I go back -
in angularjs, have 3 pages, page1.html, page2.html, page3.html , have function goback() is
$scope.goback = function() { $window.history.back(); }
when visit page1, page2, page3 , again page1,2,3 , again page1,2,3 , @ last if go everyage repeats. means page3 page 2 page 1 , again page3, 2, 1 , again page3, 2, 1.
i don't want repeat these pages, if press on goback(), should go page3, 2, 1 , home.
any appreciated.
see if using $window.history.back();
go through history.
if dont want go use data-ui-sref=""
, return on desire page.
, if want go on basis of condition add conditions if page 1 go state of page1 , on.
Comments
Post a Comment