diff --git a/lib/routing/module.dart b/lib/routing/module.dart index d8dff6495..c796f5b4e 100644 --- a/lib/routing/module.dart +++ b/lib/routing/module.dart @@ -80,29 +80,29 @@ * EditRecipe(RouteProvider routeProvider) { * RouteHandle route = routeProvider.route.newHandle(); * _loadRecipe(route); - * route.onLeave.listen((RouteEvent event) { + * route.onPreLeave.listen((RouteEvent event) { * event.allowLeave(_checkIfOkToLeave()); * }); * } * * /// Check if the editor has unsaved contents and if necessary ask * /// the user if OK to leave this page. - * Future _checkIfOkToLeave() {/* ... */} + * Future _checkIfOkToLeave() => /* ... */; * * detach() { * route.discard(); * } * } * - * [Route.onLeave] event is triggered when the browser is routed from an + * [Route.onPreLeave] event is triggered when the browser is routed from an * active route to a different route. The active route can delay and * potentially veto the navigation by passing a [Future] to - * [RouteEvent.allowLeave]. + * [RoutePreLeaveEvent.allowLeave]. * * Notice that we create a [RouteHandle] for our route. [RouteHandle] are * a convenient wrapper around [Route] that makes unsubscribing route events * easier. For example, notice that we didn't need to manually call - * [StreamSubscription.cancel] for subscription to [Route.onLeave]. Calling + * [StreamSubscription.cancel] for subscription to [Route.onPreLeave]. Calling * [RouteHandle.discard] unsubscribes all listeners created for the handle. * * ## Hierarchical Routes diff --git a/lib/routing/ng_view.dart b/lib/routing/ng_view.dart index 7dd53c940..27de32197 100644 --- a/lib/routing/ng_view.dart +++ b/lib/routing/ng_view.dart @@ -177,7 +177,7 @@ class NgView implements DetachAware, RouteProvider { * route.onEnter.listen((RouteEvent e) { * // Do something when the route is activated. * }); - * route.onLeave.listen((RouteEvent e) { + * route.onPreLeave.listen((RouteEvent e) { * // Do something when the route is de-activated. * e.allowLeave(allDataSaved()); * }); @@ -193,7 +193,7 @@ class NgView implements DetachAware, RouteProvider { * } * } * - * If user component is used outside of ng-view directive then + * If user component is used outside of `ng-view` directive then * injected [RouteProvider] will be null. */ abstract class RouteProvider {