docs(router): add api docs

This commit is contained in:
vsavkin
2016-06-28 14:49:29 -07:00
parent 0961bd1eff
commit 296a447e3c
12 changed files with 466 additions and 70 deletions

View File

@ -32,7 +32,7 @@ import {Tree, TreeNode} from './utils/tree';
* }
* ```
*
* @experimental
* @stable
*/
export class RouterState extends Tree<ActivatedRoute> {
/**
@ -75,8 +75,7 @@ function createEmptyStateSnapshot(urlTree: UrlTree, rootComponent: Type): Router
/**
* Contains the information about a component loaded in an outlet. The information is provided
* through
* the params and urlSegments observables.
* through the params, urlSegments, and data observables.
*
* ### Usage
*
@ -84,11 +83,12 @@ function createEmptyStateSnapshot(urlTree: UrlTree, rootComponent: Type): Router
* class MyComponent {
* constructor(route: ActivatedRoute) {
* const id: Observable<string> = route.params.map(p => p.id);
* const data = route.data.map(d => d.user); //includes `data` and `resolve`
* }
* }
* ```
*
* @experimental
* @stable
*/
export class ActivatedRoute {
/** @internal */
@ -110,6 +110,9 @@ export class ActivatedRoute {
}
}
/**
* @internal
*/
export class InheritedResolve {
/**
* @internal
@ -138,11 +141,12 @@ export class InheritedResolve {
* class MyComponent {
* constructor(route: ActivatedRoute) {
* const id: string = route.snapshot.params.id;
* const data = route.snapshot.data;
* }
* }
* ```
*
* @experimental
* @stable
*/
export class ActivatedRouteSnapshot {
/**
@ -195,7 +199,7 @@ export class ActivatedRouteSnapshot {
* }
* ```
*
* @experimental
* @stable
*/
export class RouterStateSnapshot extends Tree<ActivatedRouteSnapshot> {
/**