Wait for parent's permission

In accordance with:

https://github.com/angular-ui/ui-router/wiki/Nested-States-%26-Nested-Views#what-do-child-states-inherit-from-parent-states

I pasted the code.

I am trying to get kids to wait for parent's permission. Everything is working correctly, but the problem is that the child controller is not being created. Why?

edit:

$stateProvider.state('parent', {
url: 'parent',
  resolve:{
     resA:  function(){
        return {'value': 'A'};
     }
  },
  controller: function($scope, resA){
      $scope.resA = resA.value;
  }
})
.state('parent.child', {
url: '/child',
  resolve:{
     resB: function(resA){
         console.log('resolve invoked'); // it fires
        return {'value': resA.value + 'B'};
     }
  },
  controller: function($scope, resA, resB){
console.log('done'); //never fired
      $scope.resA2 = resA.value;
      $scope.resB = resB.value;
  }

      

I don't think templates are needed here.

+3
angularjs angular-ui-router


source to share


No one has answered this question yet

Check out similar questions:

75
(Angular -ui-router) Show loading animation during resolution process
64
What is the lifecycle of Angular ui-router? (for debugging silent errors)
6
ui-router starts child state until parent state resolves
4
Angular-UI Router - decide if it is waiting for the promised solution?
2
Angular UI Router - Child State Resolution ALLWAYS Pending Parent State Resolution
1
AngularJS user router UI not waiting for parent permission
1
using permission in parent state of ui router
1
How to prevent nested resolvers in some child states with angular ui-router?
0
Angularjs ui-router parent state is resolved with changing every child state
0
Angularjs ui-router balanced abstract state with http request



All Articles
Loading...
X
Show
Funny
Dev
Pics