Phenomenon:
In order to return the parent page of the child page does not refresh, need to use sub-route, if there is no form, completely no problem, when the parent page has form input, sub-page also has form input, click on the keyboard next item will show the parent page, such as:
, is the sub-routing interface, the light table at the bottom, when you click on the keyboard to mark the next item, the image will appear, the child page and the parent page appears at the same time.
Workaround, when the sub-route is gone, the parent route is hidden and then displayed when it is returned. Write a global public method, if you have encountered the same problem, you can refer to
/*Load data display loading effect*/$rootScope. $on ("$stateChangeSuccess",function(event, ToState, Toparams, FromState, fromparams) {//To being used for the back button//won ' t work when the page is reloaded. varfromparent = fromState.name.substring (0, FromState.name.lastIndexOf ('. '))); vartoparent = toState.name.substring (0, ToState.name.lastIndexOf ('. '))); //Parent route goes to sub-route start loading, sub-route does not start when returning to parent Route if(fromparent = = Toparent && (fromparent = = "| | toparent = =") &&typeofFromstate.parent = = ' undefined ' | | Fromparent.indexof (toparent) = =-1 && fromState.name.indexOf (tostate.name) = =-1 | | Fromstate.name = =Tostate.name||typeoffromstate.parent!= ' undefined ' && fromstate.parent! = Tostate.name && Tostate.parent = =fromstate.name) {$rootScope. startloading (); } /** When the parent view has an input box when the child view is entered, the next item in the last input box of the child view will pop up the parent's bug * The following variables are used when the parent layer is hidden and the variable is the "child View name" +view, for example, Configuration Sub View name is sub, the variable is just subView * in the parent layer to hide the display of the place with ng-show= '!subview '*/ if(tostate.views) { for(varKeyinchtostate.views) { if(ToState.views.hasOwnProperty (key)) {$rootScope [key+ ' View '] =true; } } } if(fromstate.views) { for(varKeyinchfromstate.views) { if(FromState.views.hasOwnProperty (key)) {$rootScope [key+ ' View '] =false; } } } });
Angular Cache with parent-child routing under iOS Click next option causes page confusion