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

Commit 19d61f7

Browse files
beatgammitmhevery
authored andcommitted
doc(routing): fix typos and errors in examples
- also fixed indentation to match Dart style guide Closes #903
1 parent 510cd5a commit 19d61f7

File tree

2 files changed

+53
-53
lines changed

2 files changed

+53
-53
lines changed

lib/animate/module.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* default [NgAnimate] implementation. This will, in turn,
2525
* perform the tracking, manipulation, and computation for animations.
2626
*
27-
* As an example of how this works, lets walk through what happens whan an
27+
* As an example of how this works, let's walk through what happens whan an
2828
* element is added to the DOM. The [CssAnimate] implementation will add the
2929
* `.ng-enter` class to new DOM elements when they are inserted into the DOM
3030
* by a directive and will read the computed style. If there is a

lib/routing/module.dart

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* and to provide custom tools to make it easier to use routing with Angular
1010
* templates.
1111
*
12-
* Lets consider a simple recipe book application. The application might have
12+
* Let's consider a simple recipe book application. The application might have
1313
* the following pages:
1414
*
1515
* * recipes list/search
@@ -25,37 +25,37 @@
2525
* * `/recipe/:recipeId/edit`
2626
*
2727
*
28-
* Lets try to define those routes in Angular. To get started we need to
28+
* Let's try to define those routes in Angular. To get started we need to
2929
* provide an implementation of [RouteInitializerFn] function.
3030
*
31-
* void initRoutes(Router router, RouteViewFactory view) {
32-
* // define routes here.
33-
* }
34-
*
35-
* var module = new Module()
36-
* ..value(RouteInitializerFn, initRoutes);
37-
*
38-
* Lets see how we could define our routes using the routing framework:
31+
* void initRoutes(Router router, RouteViewFactory view) {
32+
* // define routes here.
33+
* }
3934
*
40-
* void initRoutes(Router router, RouteViewFactory view) {
41-
* router
42-
* ..addRoute(
43-
* name: 'recipes',
44-
* path: '/recipes',
45-
* enter: view('recipes.html'))
46-
* ..addRoute(
47-
* name: 'addRecipe',
48-
* path: '/addRecipe',
49-
* enter: view('addRecipe.html'))
50-
* ..addRoute(
51-
* name: 'viewRecipe',
52-
* path: '/recipe/:recipeId/view',
53-
* enter: view('viewRecipe.html'))
54-
* ..addRoute(
55-
* name: 'editRecipe',
56-
* path: '/recipe/:recipeId/edit',
57-
* enter: view('editRecipe.html'));
58-
* }
35+
* var module = new Module()
36+
* ..value(RouteInitializerFn, initRoutes);
37+
*
38+
* Let's see how we could define our routes using the routing framework:
39+
*
40+
* void initRoutes(Router router, RouteViewFactory view) {
41+
* router.root
42+
* ..addRoute(
43+
* name: 'recipes',
44+
* path: '/recipes',
45+
* enter: view('recipes.html'))
46+
* ..addRoute(
47+
* name: 'addRecipe',
48+
* path: '/addRecipe',
49+
* enter: view('addRecipe.html'))
50+
* ..addRoute(
51+
* name: 'viewRecipe',
52+
* path: '/recipe/:recipeId/view',
53+
* enter: view('viewRecipe.html'))
54+
* ..addRoute(
55+
* name: 'editRecipe',
56+
* path: '/recipe/:recipeId/edit',
57+
* enter: view('editRecipe.html'));
58+
* }
5959
*
6060
* We defined 4 routes and for each route we set views (templates) to be
6161
* displayed when that route is "entered". For example, when the browser URL
@@ -66,7 +66,7 @@
6666
*
6767
* Notice that `viewRecipe` and `editRecipe` route paths have `recipeId`
6868
* parameter in them. We need to be able to get hold of that parameter in
69-
* order to know which recipe to load. Lets consider the following
69+
* order to know which recipe to load. Let's consider the following
7070
* `viewRecipe.html`.
7171
*
7272
* <view-recipe></view-recipe>
@@ -84,7 +84,7 @@
8484
* }
8585
*
8686
* [RouteProvider] and [Route] can be used to control navigation, specifically,
87-
* leaving of the route. For example, lets consider "edit recipe" component:
87+
* leaving of the route. For example, let's consider "edit recipe" component:
8888
*
8989
* @NgComponent(...)
9090
* class EditRecipeComponent implements NgDetachAware {
@@ -124,27 +124,27 @@
124124
* example we could have defined our routes like this:
125125
*
126126
* void initRoutes(Router router, RouteViewFactory view) {
127-
* router
128-
* ..addRoute(
129-
* name: 'recipes',
130-
* path: '/recipes',
131-
* enter: view('recipes.html'))
132-
* ..addRoute(
133-
* name: 'addRecipe',
134-
* path: '/addRecipe',
135-
* enter: view('addRecipe.html'))
136-
* ..addRoute(
137-
* name: 'recipe',
138-
* path: '/recipe/:recipeId',
139-
* mount: (Route route) => route
140-
* ..addRoute(
141-
* name: 'view',
142-
* path: '/view',
143-
* enter: view('viewRecipe.html'))
144-
* ..addRoute(
145-
* name: 'edit',
146-
* path: '/edit',
147-
* enter: view('editRecipe.html')));
127+
* router.root
128+
* ..addRoute(
129+
* name: 'recipes',
130+
* path: '/recipes',
131+
* enter: view('recipes.html'))
132+
* ..addRoute(
133+
* name: 'addRecipe',
134+
* path: '/addRecipe',
135+
* enter: view('addRecipe.html'))
136+
* ..addRoute(
137+
* name: 'recipe',
138+
* path: '/recipe/:recipeId',
139+
* mount: (Route route) => route
140+
* ..addRoute(
141+
* name: 'view',
142+
* path: '/view',
143+
* enter: view('viewRecipe.html'))
144+
* ..addRoute(
145+
* name: 'edit',
146+
* path: '/edit',
147+
* enter: view('editRecipe.html')));
148148
* }
149149
*
150150
*/

0 commit comments

Comments
 (0)