延迟AngularJS路由更改直到加载页面

时间:2018-03-06 13:22:54

标签: javascript angularjs

我使用库" ui-router"在角度。当我到其他页面路由到负载控制器最后一页显示的同时在路由页面有问题,同时2页显示在一页,加载页面,最后一页删除。 如何解决问题延迟?

app.config([
"$stateProvider", "$urlRouterProvider",
function (stateProvider, urlRouterProvider) {


    urlRouterProvider.otherwise("/dashboard");

    stateProvider
        .state("Dashboard",
        {
            url: "/dashboard",
            templateUrl: "/Modules/Dashboard/Partials/dashboard.html",
            controller: "DashboardCtrl as self"
        })
        .state("Deposit",
        {
            url: "/dashboard/desposit",
            templateUrl: "/Modules/Dashboard/Partials/deposit.html",
            controller: "DepositCtrl as self"
        })
        .state("PeymentRequest",
        {
            url: "/dashboard/peymentRequest",
            templateUrl: "/Modules/Dashboard/Partials/peymentRequest.html",
            controller: "PeymentRequestCtrl as self"
        })
        .state("ChangeBroker",
        {
            url: "/dashboard/changeBroker",
            templateUrl: "/Modules/Dashboard/Partials/changeBroker.html",
            controller: "ChangeBrokerCtrl as self"
        });
}

]);

0 个答案:

没有答案