var PageManager = {
_pageindex: 1,
init:function () {
var = this ;
$scope. $on (' $locationChangeStart ', function() {
var state = History.state | | {};
console.log (state._pageindex)
console. Log (Self._pageindex)
if (state._pageindex <= self._pageindex) {
console.log (' back ')
Add an animated style
self._back ();
} else {
console.log (' jump ')
Add an animated style
self._go ();
}
if (history.state) {
this._pageindex = history.state._pageindex;
}
this._pageindex--;
return this;
});
},
_go: function (config) {
This._pageindex + +;
history.replacestate && history.replacestate ({_pageindex: this._pageindex}, ', location.href);
return this ;
},
_back: function (config) {
This._pageindex --;
return this ;
},
}
. Init ();
Single page jump add back and jump rotation painting (imitation app) only for single page and jump useful, I use is angualr, there will not be a private messages to ask me.