ANGULARJS Routing Problem Processing collection

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.