Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit a30986b

Browse files
committed
chore(docs): Added missing docs for a few route entries
1 parent 96c0bcc commit a30986b

File tree

3 files changed

+29
-13
lines changed

3 files changed

+29
-13
lines changed

lib/routing/module.dart

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
* }
7474
* }
7575
*
76-
* [RouteProvider] and [Route] can be used to control navigation, specifically,
76+
* [RouteProvider] and `Route` can be used to control navigation, specifically,
7777
* leaving of the route. For example, let's consider "edit recipe" component:
7878
*
7979
* @Component(...)
@@ -96,16 +96,16 @@
9696
* }
9797
* }
9898
*
99-
* [Route.onPreLeave] event is triggered when the browser is routed from an
99+
* `Route.onPreLeave` event is triggered when the browser is routed from an
100100
* active route to a different route. The active route can delay and
101-
* potentially veto the navigation by passing a [Future<bool>] to
102-
* [RoutePreLeaveEvent.allowLeave].
101+
* potentially veto the navigation by passing a `Future<bool>` to
102+
* `RoutePreLeaveEvent.allowLeave`.
103103
*
104-
* Notice that we create a [RouteHandle] for our route. [RouteHandle] are
105-
* a convenient wrapper around [Route] that makes unsubscribing route events
104+
* Notice that we create a [RouteHandle] for our route. `RouteHandle` are
105+
* a convenient wrapper around `Route` that makes unsubscribing route events
106106
* easier. For example, notice that we didn't need to manually call
107-
* [StreamSubscription.cancel] for subscription to [Route.onPreLeave]. Calling
108-
* [RouteHandle.discard] unsubscribes all listeners created for the handle.
107+
* `StreamSubscription.cancel` for subscription to `Route.onPreLeave`. Calling
108+
* `RouteHandle.discard` unsubscribes all listeners created for the handle.
109109
*
110110
* ## Hierarchical Routes
111111
*
@@ -142,6 +142,11 @@ part 'routing.dart';
142142
part 'ng_view.dart';
143143
part 'ng_bind_route.dart';
144144
145+
/**
146+
* A module that defines all necessary bindings for Angular routing. This
147+
* module is included in [AngularModule] and typically you don't need to
148+
* install it manually.
149+
*/
145150
class RoutingModule extends Module {
146151
RoutingModule({bool usePushState: true}) {
147152
bind(NgRoutingUsePushState);
@@ -162,10 +167,10 @@ class RoutingModule extends Module {
162167

163168
/**
164169
* Allows configuration of [Router.useFragment]. By default [usePushState] is
165-
* true, so the router will listen to [Window.onPopState] and route URLs like
170+
* true, so the router will listen to `Window.onPopState` and route URLs like
166171
* "http://host:port/foo/bar?baz=qux". Both the path and query parts of the URL
167172
* are used by the router. If [usePushState] is false, router will listen to
168-
* [Window.onHashChange] and route URLs like
173+
* `Window.onHashChange` and route URLs like
169174
* "http://host:port/path#/foo/bar?baz=qux". Everything after hash (#) is used
170175
* by the router.
171176
*/

lib/routing/ng_view.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
part of angular.routing;
22

33
/**
4-
* A directive that works with the [Router] and loads the template associated with the current
4+
* A directive that works with the `Router` and loads the template associated with the current
55
* route.
66
*
77
* <ng-view></ng-view>
@@ -198,7 +198,7 @@ class NgView implements DetachAware, RouteProvider {
198198
*/
199199
abstract class RouteProvider {
200200
/**
201-
* Returns [Route] for current view.
201+
* Returns `Route` for current view.
202202
*/
203203
Route get route;
204204

lib/routing/routing.dart

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ class RouteViewFactory {
7171
}
7272
}
7373

74+
/**
75+
* A factory function for [NgRouteCfg]. Most of the parameters are passes directly
76+
* to route_hierachical API for route configuration (`Route.addRoute`).
77+
*
78+
* * [view] - a URL of the template to load into ng-view when route is entered.
79+
* * [viewHtml] - HTML of the template to load into ng-view when route is entered.
80+
* * [modules] - a list of di modules to load for the route/ng-view.
81+
*/
7482
NgRouteCfg ngRoute({String path, String view, String viewHtml,
7583
Map<String, NgRouteCfg> mount, modules(), bool defaultRoute: false,
7684
RoutePreEnterEventHandler preEnter, RouteEnterEventHandler enter,
@@ -79,7 +87,10 @@ NgRouteCfg ngRoute({String path, String view, String viewHtml,
7987
new NgRouteCfg(path: path, view: view, viewHtml: viewHtml, mount: mount,
8088
modules: modules, defaultRoute: defaultRoute, preEnter: preEnter, preLeave: preLeave,
8189
enter: enter, leave: leave, dontLeaveOnParamChanges: dontLeaveOnParamChanges);
82-
90+
/**
91+
* Object containing route configuration parameters. Typically this class
92+
* is not used directly, but rather constructed via [ngRoute] factory function.
93+
*/
8394
class NgRouteCfg {
8495
final String path;
8596
final String view;

0 commit comments

Comments
 (0)