Skip to content
This repository was archived by the owner on Nov 21, 2025. It is now read-only.
This repository was archived by the owner on Nov 21, 2025. It is now read-only.

nested resolves #30

@mastef

Description

@mastef

A really cool feature of UI Router are nested resolves. Which means your second resolve will wait for the first resolve to finish, and use that info. ( quick example from : https://medium.com/opinionated-angularjs/advanced-routing-and-resolves-a2fcbf874a1c#e7cc ) e.g. :

$stateProvider.state('users.profile', {
  url: '/:id',
  templateUrl: 'views/users.profile.html',
  controller: 'UsersController',
  resolve: {
    user: function($stateParams, UserService) {
      return UserService.find($stateParams.id);
    },
    tasks: function(TaskService, user) {
      return user.canHaveTasks() ?
        TaskService.find(user.id) : [];
    }
  }
});

Is there a way to accomplish this with deferred bootstrap? The use-case would be that the first resolve loads the app configuration, and the second resolve checks and syncs the user session based on the app config data. ( Something like this : http://grab.by/EwoI )

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions