Angular Routing status changes can be
$stateChangeStart
$stateChangeSuccess
$stateChangeError
Monitoring, by injecting $location ' implementation of state management
function run ($ionicPlatform, $location, Service, $rootScope, $ Stateparams) {//routed listener event $rootScope. $on (' $stateChangeStart ', function (event, tostate, Toparams, FromState, Frompara ms) {Console.log (event); Console.log (tostate); Console.log (Toparams); Console.log (fromstate); Console.log (Fromparams); if (Tostate.name = = "Homepage") {//Get parameters can be adjusted after the request to determine what page to render, rendering different pages through the $location implement if (toparams.id = = 10) { $location. Path ();//Gets the routing address//$location. Path ('/validation '). replace (); Event.preventdefault () can prevent template parsing}})//statechangesuccess triggers $rootScope when the template parsing is complete. $on (' $stateChange Success ', function (event, tostate, Toparams, FromState, Fromparams) {})//$stateChangeError triggered when an error occurs during template parsing $r Ootscope. $on (' $stateChangeError ', function (event, tostate, Toparams, FromState, Fromparams, error) {})}
$viewContentLoadingrender status through and listening to pages in page rendering $viewContentLoaded : Render start and render end.
Scope. $watch (' $viewContentLoading ', function (event, viewconfig) { alert (' Before the template load is completed ');//$viewContentLoaded- When the view load is complete, the DOM rendering is completed and the $scope emitted by the view. $scope. $watch (' $viewContentLoaded ', function (event) { alert (' After completion of template loading ');});
ANGULARJS Routing Problem Processing collection