Ui-router displays the template before state changes

I have a nested state structure like this:

$stateProvider
        .state('main', {
            url: '',
            abstract: true,
            templateUrl: ...
            controller: mainController,
            resolve: {
                Resolve1: ...
                Resolve2: ...
            }
        })
        .state('main.state1', {
            url: '^/state1/:id/',
            templateUrl: ....
            controller: state1Controller,
            resolve: {
                Resolve11: ...
                Resolve22: ...
            },
        })
        .state('main.state2', {
        ....

From what I see when you are in a state main.state1, and you go to the same state with a different parameter id, the template for is main.state1displayed fine, but the template for main(parent) is displayed before the state changes (I think it does not wait for data permission main.state1). This leads to the visualization of the view with the wrong data (more precisely, the state parameters that I use to generate the links are incorrect).

Mine mainControllerhas tags $stateParamsand $stateentered by him, and that I get data from.

Has anyone noticed this before? Is it design or is it a mistake?

?

, ui-router , ( ). , - , ...

UPDATE:

, , ( ), , , . , , - , , "main. *". .

2:

, , ui-sref ( , href, ui-sref = "main.state1 ({id: {{getId()}} })" ). ng-href , .

, , .

, ui-sref , .

...

3:

, , . ... ...

+4
2

"" ng-click $state.go() .

ui-router.

+1

ui-router " " . , main , main.state1. , HTML DOM - main , main.state1. , AFAIK - .

0

All Articles