During the normal lifecycle of an Aurelia application, components are created, updated, and destroyed. Aurelia provides various hooks into this component life cycle so that you can control your application and perform specific actions at various times with that component. 

Here is the sequence in which various hooks are triggered and the data they receive as parameters. 
class AureliaViewModel {
    constructor() {
        
    }
    canActivate(params, routeConfig, navigationInstructions) {
        
    }
    activate(params, routeConfig, navigationInstructions) {
        
    }
    created(owningView, myView) {
        
    }
    bind(bindingContext, overrideContext) {
        
    }
    attached() {
        
    }
    canDeactivate() {
        
    }
    deactivate() {
        
    }
    detached() {
        
    }
    unbind() {
       
    }
}

A brief explanation of each callback event follows. 
  • constructor() 
    • View-model is initialized and no Aurelia specific actions have been undertaken. 
    • At this point, your class is just a standard JavaScript class. 
  • canActivate(params: any, routeConfig: RouteConfig, navigationInstruction: NavigationInstruction)
    • Implement this hook if you want to control whether or not your view-model can be navigated to. 
    • Return a boolean value, a promise for a boolean value, or a navigation command.
  • activate(params: any, routeConfig: RouteConfig, navigationInstruction: NavigationInstruction)
    • Implement this hook if you want to perform custom logic just before your view-model is displayed. 
    • You can optionally return a promise to tell the router to wait to bind and attach the view until after you finish your work.
  • created(owningView: View, myView: View)
    • Implement this hook if you want to perform custom logic after the constructor has been called. At this point in time, the view has also been created and both the view-model and the view are connected to their controller. 
    • The hook will receive the instance of the "owningView". This is the view that the component is declared inside of. If the component itself has a view, this will be passed second.
  • bind(bindingContext: Object, overrideContext: Object)
    • Databinding is then activated on the view and view-model. If the view-model has a bind callback, it will be invoked at this time. 
    • The "binding context" to which the component is being bound will be passed first. 
    • An "override context" will be passed second. The override context contains information used to traverse the parent hierarchy and can also be used to add any contextual properties that the component wants to add. 
  • attached()
    • The component has been attached to the DOM. Similar to the browser's native OnDOMReady event. 
    • Implement this hook if you want to perform custom logic when the component is attached to the DOM (in the HTML document).
  • canDeactivate()
    • Implement this hook if you want to control whether or not the router can navigate away from your view-model when moving to a new route. 
    • Return a boolean value, a promise for a boolean value, or a navigation command.
  • deactivate()
    • Implement this hook if you want to perform custom logic when your view-model is being navigated away from. 
    • You can optionally return a promise to tell the router to wait until after you finish your work
  • detached()
    • This callback is fired when the component is removed from the DOM. 
  • unbind()
    • After the component has been removed from the DOM, any binding that occurred during the bind callback is unbound. 

Sources:
  1. The Lifecycle Explained
  2. Aurelia.io