Hi. I use ionic to build rich app with one “master state”. The master state works as mediator, it includes many templates (nested views) that activates depending on url parameters. Application should looks like one view application, no transitions needed. Application should not reload pages between state changes, but url should change synchronous with changing state.
I think that this behaviour can be achieved with standard ui-router api. My application have one state, like this:
.sate('master', { url: '/master?search&document&...' ... }
I try to change state from ‘/master’ to ‘/master?search=something’ withoud re-rendering page. When i call $sate.go(’/master’, { search: ‘something’}, { notify: false }) all works fine, except one thing - ionic does not push previous state to history. I don`t want to record history by my self. When i call $state.go(’/master’, { search: ‘something’}) history updated correctly, but ionic re render my view.
I look to ionic sources, and it looks like there no chance to split history tracking with view rendering.
// file navView.js:
$scope.$on('$stateChangeSuccess', function() {
updateView(false);
});
// function updateView(false)
// register, update and transition to the new view
navViewCtrl.register(viewLocals);
// file navViewController.js
self.register = function(viewLocals) {
var leavingView = extend({}, $ionicHistory.currentView());
// register that a view is coming in and get info on how it should transition
var registerData = $ionicHistory.register($scope, viewLocals);
// update which direction
self.update(registerData);
// begin rendering and transitioning
var enteringView = $ionicHistory.getViewById(registerData.viewId) || {};
var renderStart = (disableRenderStartViewId !== registerData.viewId);
self.render(registerData, viewLocals, enteringView, leavingView, renderStart, true);
};
I want to push state to history, but i don`t need to render views, because i already have actual view. It is possible to do?
Also i already tried:
- reloadOnSearch = false - this does not work, because it`s also does not push states to history
- state hierarchy - works fine when we change state from parent to child, but for siblings we have the same problems that in one master state.
- $ionicHistory.nextViewOptions({disableAnimate: true}) - does nothing, only disables transition, but page still re render