I think $ionicViewService.clearHistory() is only for clearing histories. I want to reinitialise $rootScope.$viewHistory from a hierarchy json file such as
{“histories”:{“root”:{“historyId”:“root”,“parentHistoryId”:null,“stack”:[{“viewId”:“002”,“index”:0,“historyId”:“root”,“backViewId”:null,“forwardViewId”:“004”,“stateId”:“app.home_mode=local”,“stateName”:“app.home”,“stateParams”:{“mode”:“local”},“url”:"/local/home"},{“viewId”:“004”,“index”:1,“historyId”:“root”,“backViewId”:“002”,“forwardViewId”:“005”,“stateId”:“app.menu_mode=local_menuId=root”,“stateName”:“app.menu”,“stateParams”:{“mode”:“local”,“menuId”:“root”,“productID”:null},“url”:"/local/menu/root"},{“viewId”:“005”,“index”:2,“historyId”:“root”,“backViewId”:“004”,“forwardViewId”:null,“stateId”:“app.menu_mode=local_menuId=L1Alessi”,“stateName”:“app.menu”,“stateParams”:{“mode”:“local”,“menuId”:“L1Alessi”,“productID”:null},“url”:"/local/menu/L1Alessi"}],“cursor”:2}},“views”:{“002”:{“viewId”:“002”,“index”:0,“historyId”:“root”,“backViewId”:null,“forwardViewId”:“004”,“stateId”:“app.home_mode=local”,“stateName”:“app.home”,“stateParams”:{“mode”:“local”},“url”:"/local/home"},“003”:{“viewId”:“003”,“index”:1,“historyId”:“root”,“backViewId”:“002”,“forwardViewId”:null,“stateId”:“app.menu_mode=local_menuId=notroot,L1Alessi”,“stateName”:“app.menu”,“stateParams”:{“mode”:“local”,“menuId”:“notroot,L1Alessi”,“productID”:null},“url”:"/local/menu/notroot,L1Alessi"},“004”:{“viewId”:“004”,“index”:1,“historyId”:“root”,“backViewId”:“002”,“forwardViewId”:“005”,“stateId”:“app.menu_mode=local_menuId=root”,“stateName”:“app.menu”,“stateParams”:{“mode”:“local”,“menuId”:“root”,“productID”:null},“url”:"/local/menu/root"},“005”:{“viewId”:“005”,“index”:2,“historyId”:“root”,“backViewId”:“004”,“forwardViewId”:null,“stateId”:“app.menu_mode=local_menuId=L1Alessi”,“stateName”:“app.menu”,“stateParams”:{“mode”:“local”,“menuId”:“L1Alessi”,“productID”:null},“url”:"/local/menu/L1Alessi"}},“backView”:{“viewId”:“004”,“index”:1,“historyId”:“root”,“backViewId”:“002”,“forwardViewId”:“005”,“stateId”:“app.menu_mode=local_menuId=root”,“stateName”:“app.menu”,“stateParams”:{“mode”:“local”,“menuId”:“root”,“productID”:null},“url”:"/local/menu/root"},“forwardView”:null,“currentView”:{“viewId”:“005”,“index”:2,“historyId”:“root”,“backViewId”:“004”,“forwardViewId”:null,“stateId”:“app.menu_mode=local_menuId=L1Alessi”,“stateName”:“app.menu”,“stateParams”:{“mode”:“local”,“menuId”:“L1Alessi”,“productID”:null},“url”:"/local/menu/L1Alessi"},“disabledRegistrableTagNames”:[“ION-TABS”,“ION-SIDE-MENUS”]}