RouterHook class

An interface that can be extended in order to hook into a route navigation.

A class should extend this class and be injected along with the router to hook into route navigation.

@Injectable
class MyHook implements RouterHook {}

bootstrap(MyAppComponent, [
  routerProviders,
  new Provider(RouterHook, useClass: MyHook)]);

Some example uses could include programmatically redirecting or preserving navigation params.

Constructors

RouterHook()

Properties

hashCode → int
The hash code for this object. [...]
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

canActivate(Object componentInstance, RouterState oldState, RouterState newState) → Future<bool>
Called by the router to indicate if a component canActivate. [...]
canDeactivate(Object componentInstance, RouterState oldState, RouterState newState) → Future<bool>
Called by the router to indicate if a component canDeactivate. [...]
canNavigate() → Future<bool>
Called by the router to indicate if navigation is allowed. [...]
canReuse(Object componentInstance, RouterState oldState, RouterState newState) → Future<bool>
Called by the router to indicate if a component canReuse. [...]
Called by the router to transform the params before a route navigation. [...]
Called by the router to transform the path before a route navigation. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator. [...]
inherited