angular-ui-router
  • Introduction
  • Configuring State
  • Activating State
  • Named Views
  • Nested State
  • onEnter onExit
  • Passing Data
  • Resolve Property
  • State Params
  • State Service
  • State Events
  • Abstract State
Powered by GitBook
On this page

Was this helpful?

Resolve Property

.state('activities', {
    url: '/activities',
    controller: 'AllActivitiesController',
    controllerAs: 'activities',
    templateUrl: '/app/templates/allActivities.html',
    resolve: {
        activities: function (dataService) {
            return dataService.getAllActivities();
    }}
})
  • List of dependencies to inject into the controller

  • Promises must resolve before the state change occurs

  • Result is injected into controller with the name specified in resolve

PreviousPassing DataNextState Params

Last updated 5 years ago

Was this helpful?