RouterHook class abstract

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.

class MyHook extends RouterHook {}

@GenerateInjector([
  ClassProvider(RouterHook, useClass: MyHook),
  routerProviders,
])
final InjectorFactory injector = ng.injector$Injector;

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

Constructors

RouterHook()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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 nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited