p.location-badge.
exported from angular2/router
defined in angular2/src/router/interfaces.ts (line 7)
:markdown
Defines route lifecycle method [onActivate], which is called by the router at the end of a
successful route navigation.
For a single component's navigation, only one of either [onActivate] or [onReuse] will be called,
depending on the result of [canReuse].
If `onActivate` returns a promise, the route change will wait until the promise settles to
instantiate and activate child components.
## Example
```
@Directive({
selector: 'my-cmp'
})
class MyCmp implements OnActivate {
onActivate(next, prev) {
this.log = 'Finished navigating from ' + prev.urlPath + ' to ' + next.urlPath;
}
}
```
.l-main-section
h2 Members
.l-sub-section
h3#onActivate onActivate
pre.prettyprint
code.
onActivate(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction)
:markdown