Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 2842058

Browse files
committed
docs(router): document new router and samples - phase 2
1 parent 596825a commit 2842058

File tree

11 files changed

+20
-18
lines changed

11 files changed

+20
-18
lines changed

public/docs/_examples/router-deprecated/e2e-spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ describe('Router', function () {
9292
function crisisCenterEdit(index, shouldSave) {
9393
var page = getPageStruct();
9494
var crisisEle, crisisText;
95-
page.crisisHref.click().then(function () {
95+
page.crisisHref.click()
96+
.then(function () {
9697
crisisEle = page.crisisList.get(index);
9798
return crisisEle.getText();
9899
}).then(function (text) {

public/docs/_examples/router-deprecated/ts/app/app.component.1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { HeroListComponent } from './hero-list.component';
1414
selector: 'my-app',
1515
// #docregion template
1616
template: `
17-
<h1>Component Router</h1>
17+
<h1>Component Router (Deprecated)</h1>
1818
<nav>
1919
<a [routerLink]="['CrisisCenter']">Crisis Center</a>
2020
<a [routerLink]="['Heroes']">Heroes</a>

public/docs/_examples/router-deprecated/ts/app/app.component.2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {HeroService} from './heroes/hero.service';
2626
@Component({
2727
selector: 'my-app',
2828
template: `
29-
<h1>Component Router</h1>
29+
<h1>Component Router (Deprecated)</h1>
3030
<nav>
3131
<a [routerLink]="['CrisisCenter']">Crisis Center</a>
3232
<a [routerLink]="['Heroes']">Heroes</a>

public/docs/_examples/router-deprecated/ts/app/app.component.3.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import {HeroService} from './heroes/hero.service';
3535
*/
3636
// #docregion template
3737
template: `
38-
<h1 class="title">Component Router</h1>
38+
<h1 class="title">Component Router (Deprecated)</h1>
3939
<nav>
4040
<a [routerLink]="['CrisisCenter', 'CrisisList']">Crisis Center</a>
4141
<a [routerLink]="['CrisisCenter', 'CrisisDetail', {id:1}]">Dragon Crisis</a>

public/docs/_examples/router-deprecated/ts/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {HeroService} from './heroes/hero.service';
1414
selector: 'my-app',
1515
// #docregion template
1616
template: `
17-
<h1 class="title">Component Router</h1>
17+
<h1 class="title">Component Router (Deprecated)</h1>
1818
<nav>
1919
<a [routerLink]="['CrisisCenter']">Crisis Center</a>
2020
<a [routerLink]="['Heroes']">Heroes</a>

public/docs/_examples/router-deprecated/ts/index.1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<!-- #docregion base-href -->
66
<base href="/">
77
<!-- #enddocregion base-href -->
8-
<title>Router Sample v.1</title>
8+
<title>Router (Deprecated) Sample v.1</title>
99
<meta charset="UTF-8">
1010
<meta name="viewport" content="width=device-width, initial-scale=1">
1111
<link rel="stylesheet" href="styles.css">

public/docs/_examples/router-deprecated/ts/index.2.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<html>
44
<head>
55
<base href="/">
6-
<title>Router Sample v.2</title>
6+
<title>Router (Deprecated) Sample v.2</title>
77
<meta charset="UTF-8">
88
<meta name="viewport" content="width=device-width, initial-scale=1">
99
<link rel="stylesheet" href="styles.css">

public/docs/_examples/router-deprecated/ts/index.3.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<html>
44
<head>
55
<base href="/">
6-
<title>Router Sample v.3</title>
6+
<title>Router (Deprecated) Sample v.3</title>
77
<meta charset="UTF-8">
88
<meta name="viewport" content="width=device-width, initial-scale=1">
99
<link rel="stylesheet" href="styles.css">

public/docs/_examples/router-deprecated/ts/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<head>
55
<!-- Set the base href -->
66
<base href="/">
7-
<title>Router Sample</title>
7+
<title>Router (Deprecated) Sample</title>
88
<meta charset="UTF-8">
99
<meta name="viewport" content="width=device-width, initial-scale=1">
1010
<link rel="stylesheet" href="styles.css">

public/docs/_examples/router/e2e-spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ describe('Router', function () {
9292
function crisisCenterEdit(index, shouldSave) {
9393
var page = getPageStruct();
9494
var crisisEle, crisisText;
95-
page.crisisHref.click().then(function () {
95+
page.crisisHref.click()
96+
.then(function () {
9697
crisisEle = page.crisisList.get(index);
9798
return crisisEle.getText();
9899
}).then(function (text) {

public/docs/ts/latest/guide/router.jade

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,17 @@ include ../_util-fns
4040

4141
We'll learn many router details in this chapter which covers
4242

43-
* Setting the [base href](#base-href)
44-
* Importing from the [router library](#import)
43+
* setting the [base href](#base-href)
44+
* importing from the [router library](#import)
4545
* [configuring a router](#route-config)
4646
* the [link parameters array](#link-parameters-array) that propels router navigation
4747
* navigating when the user clicks a data-bound [RouterLink](#router-link)
4848
* navigating under [program control](#navigate)
49-
* embedding critical information in the URL with [route parameters](#route-parameters)
49+
* embedding critical information in the URL with [positional parameters](#positional-parameters)
5050
* creating a [child router](#child-router) with its own routes
5151
* setting a [default route](#default)
5252
* confirming or canceling navigation with [router lifecycle hooks](#lifecycle-hooks)
53-
* passing optional information in [query parameters](#query-parameters)
53+
* passing optional information in [matrix parameters](#matrix-parameters)
5454
* choosing the "HTML5" or "hash" [URL style](#browser-url-styles)
5555

5656
We proceed in phases marked by milestones building from a simple two-pager with placeholder views
@@ -604,7 +604,7 @@ code-example(format="." language="bash").
604604
This array is similar to the *link parameters array* we met [earlier](#shell-template) in an anchor tag while
605605
binding to the `RouterLink` directive. This time we see it in code rather than in HTML.
606606

607-
<a id="route-parameters"></id>
607+
<a id="positional-parameters"></id>
608608
### Setting the route parameters object
609609

610610
We're navigating to the `HeroDetailComponent` where we expect to see the details of the selected hero.
@@ -1013,13 +1013,13 @@ code-example(format="").
10131013
`)
10141014

10151015

1016-
<a id="query-parameters"></a>
1016+
<a id="matrix-parameters"></a>
10171017
<a id="query-parameter"></a>
10181018
.l-main-section
10191019
:marked
10201020
## Milestone #4: Query Parameters
10211021

1022-
We use [*route parameters*](#route-parameters) to specify a *required* parameterized value *within* the route URL
1022+
We use [*route parameters*](#positional-parameters) to specify a *required* parameterized value *within* the route URL
10231023
as we do when navigating to the `HeroDetailComponent` in order to view-and-edit the hero with *id:15*.
10241024
code-example(format="." language="bash").
10251025
localhost:3000/hero/15
@@ -1060,7 +1060,7 @@ figure.image-display
10601060
* the value is optional.
10611061
* the value is complex and/or multi-variate.
10621062

1063-
<a id="route-parameters-object"></a>
1063+
<a id="positional-parameters-object"></a>
10641064
### Route parameters object
10651065
When navigating to the `HeroDetailComponent` we specified the `id` of the hero-to-edit in the
10661066
*route parameters object* and made it the second item of the [*link parameters array*](#link-parameters-array).

0 commit comments

Comments
 (0)