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?

onEnter onExit

Usefull if want to show alert before leaving the page

.state('activities', {
    url: '/activities',
    controller: 'AllActivitiesController',
    controllerAs: 'activities',
    templateUrl: '/app/templates/allActivities.html',
    onEnter: function(){
        console.log("Entering into state");
    },
    onExit: function(){
        console.log("Leaving the state");
    }
})
PreviousNested StateNextPassing Data

Last updated 5 years ago

Was this helpful?