+ `
+})
+export class UnauthorizedComponent {}
diff --git a/public/docs/_examples/cb-router/ts/example-config.json b/public/docs/_examples/cb-router/ts/example-config.json
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/public/docs/_examples/cb-router/ts/index.html b/public/docs/_examples/cb-router/ts/index.html
new file mode 100644
index 0000000000..1318189c10
--- /dev/null
+++ b/public/docs/_examples/cb-router/ts/index.html
@@ -0,0 +1,40 @@
+
+
+
+
+ Routing
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Loading app...
+
+
+
diff --git a/public/docs/_examples/cb-router/ts/plnkr.json b/public/docs/_examples/cb-router/ts/plnkr.json
new file mode 100644
index 0000000000..c345f09ddb
--- /dev/null
+++ b/public/docs/_examples/cb-router/ts/plnkr.json
@@ -0,0 +1,9 @@
+{
+ "description": "Routing Cookbook",
+ "files":[
+ "!**/*.d.ts",
+ "!**/*.js",
+ "!app/*.[1,2,3,4].*"
+ ],
+ "tags":["cookbook", "router"]
+}
diff --git a/public/docs/ts/latest/cookbook/_data.json b/public/docs/ts/latest/cookbook/_data.json
index 211e12bfd4..68f7cbd74b 100644
--- a/public/docs/ts/latest/cookbook/_data.json
+++ b/public/docs/ts/latest/cookbook/_data.json
@@ -26,6 +26,11 @@
"intro": "Render dynamic forms with NgFormModel"
},
+ "router": {
+ "title": "Routing",
+ "intro": "Using the router navigation cycle"
+ },
+
"set-document-title": {
"title": "Set the Document Title",
"intro": "Setting the document or window title using the Title service."
diff --git a/public/docs/ts/latest/cookbook/router.jade b/public/docs/ts/latest/cookbook/router.jade
new file mode 100644
index 0000000000..c8403532e7
--- /dev/null
+++ b/public/docs/ts/latest/cookbook/router.jade
@@ -0,0 +1,156 @@
+include ../_util-fns
+
+
+:marked
+ This cookbook contains recipes for common router scenarios
+ for reacting to the router navigation cycle.
+
+//
+ .l-sub-section
+
+
+:marked
+ ## Table of contents
+
+ [Subscribing to router URL updates](#router-subscription)
+
+ [Showing a loading indicator](#loading-indicator)
+
+ [Updating the page title](#page-title)
+
+ [Navigating without updating the URL](#silent-navigation)
+
+ [Parent and child route share data via a service](#parent-child-route-communication)
+
+:marked
+ **See the [live example](/resources/live-examples/cb-router/ts/plnkr.html)**.
+
+.l-main-section
+
+:marked
+ ## Subscribing to router URL updates
+
+ The router service provides an observable that emits a URL when the navigation has
+ successfully completed. The top level router handles navigation, so we
+ want to subscribe to it for updates.
+
++makeTabs(
+ `cb-router/ts/app/app.component.1.ts,
+ cb-router/ts/app/home.component.1.ts`,
+ null,
+ `app.component.ts,
+ home.component.ts`
+ )
+
+:marked
+ ### Test it
+
+ E2E test that the router subscription is updated after navigation completes
+
++makeExample('cb-router/e2e-spec.js', 'router-subscription')
+
+:marked
+ [Back to top](#top)
+
+.l-main-section
+
+:marked
+ ## Showing a loading indicator until navigation completes
+
+ The `router.navigating` property is a boolean value toggled when the router starts
+ and finishes navigating. We will use this value to toggle display of a loading
+ indicator until the router completes the navigation cycle.
+
++makeTabs(
+ `cb-router/ts/app/app.component.2.ts,
+ cb-router/ts/app/home.component.2.ts,
+ cb-router/ts/app/navigating.component.ts`,
+ null,
+ `app.component.ts,
+ home.component.ts,
+ navigating.component.ts`
+ )
+
+:marked
+ [Back to top](#top)
+
+.l-main-section
+
+
+:marked
+ ## Updating the page title using the router
+
+ Using the lifecycle hook `routerOnActivate` combined with the `Title` service,
+ we can update the browser page title that appears in the window navigation history
+ and shows up in the back/forward buttons during routing.
+
+ For more information on using the `Title` service,
+ see the [Document Title Cookbook](../cookbook/set-document-title.html#top)
+
++makeTabs(
+ `cb-router/ts/app/main.ts,
+ cb-router/ts/app/app.component.3.ts,
+ cb-router/ts/app/home.component.ts`,
+ `,,page-title`,
+ `main.ts,
+ app.component.ts,
+ home.component.ts`
+ )
+
+:marked
+ ### Test it
+
+ E2E test that the page title is updated after navigating
+
++makeExample('cb-router/e2e-spec.js', 'page-title')
+
+:marked
+ [Back to top](#top)
+
+.l-main-section
+
+:marked
+ ## Navigating without updating the URL
+
+ Sometimes you want to use the router to update the application view
+ without updating the URL. This keeps the current URL available for bookmarks,
+ while switching out the content displayed.
+
++makeTabs(
+ `cb-router/ts/app/app.component.4.ts,
+ cb-router/ts/app/restricted.component.ts,
+ cb-router/ts/app/unauthorized.component.ts`,
+ 'silent-navigation, silent-navigation, silent-navigation',
+ `app.component.ts,
+ restricted.component.ts,
+ unauthorized.component.ts`
+ )
+
+.l-sub-section
+ :marked
+ An alternate way to trigger silent navigation is to navigate by URL to update the application view.
+
++makeExample('cb-router/ts/app/restricted.component.1.ts', 'silent-url', 'restricted.component.ts (alternate)')
+
+:marked
+ ### Test it
+
+ Test that the application view updates without changing the current browser URL.
+
++makeExample('cb-router/e2e-spec.js', 'silent-navigation')
+
+:marked
+ [Back to top](#top)
+
+.l-main-section
+
+:marked
+ ## Parent and child route communicate via a service
+
+ Since our routes are mapped to components, we should use a service to share data
+ between routes. Just as routes have parent and child routes, we should treat them
+ the same way to communicate allowing our
+ [parent and children to communicate via a service](../cookbook/component-communication.html#bidirectional-service)
+
+:marked
+ [Back to top](#top)