docs(router): move examples to `@usageNotes` (#26039)

PR Close #26039
This commit is contained in:
Pete Bacon Darwin 2018-09-20 14:50:32 +01:00 committed by Kara Erickson
parent fef9cebed0
commit ff028f0b39
6 changed files with 21 additions and 6 deletions

View File

@ -43,6 +43,7 @@ import {UrlSegment, UrlSegmentGroup} from './url_tree';
* - `loadChildren` is a reference to lazy loaded child routes. See `LoadChildren` for more
* info.
*
* @usageNotes
* ### Simple Configuration
*
* ```

View File

@ -374,12 +374,14 @@ export class Router {
get url(): string { return this.serializeUrl(this.currentUrlTree); }
/** @internal */
triggerEvent(e: Event): void { (this.events as Subject<Event>).next(e); }
triggerEvent(event: Event): void { (this.events as Subject<Event>).next(event); }
/**
* Resets the configuration used for navigation and generating links.
*
* ### Usage
* @usageNotes
*
* ### Example
*
* ```
* router.resetConfig([
@ -414,7 +416,9 @@ export class Router {
* When given an activate route, applies the given commands starting from the route.
* When not given a route, applies the given command starting from the root.
*
* ### Usage
* @usageNotes
*
* ### Example
*
* ```
* // create /team/33/user/11
@ -486,7 +490,9 @@ export class Router {
* - resolves to 'false' when navigation fails,
* - is rejected when an error happens.
*
* ### Usage
* @usageNotes
*
* ### Example
*
* ```
* router.navigateByUrl("/team/33/user/11");
@ -522,7 +528,9 @@ export class Router {
* - resolves to 'false' when navigation fails,
* - is rejected when an error happens.
*
* ### Usage
* @usageNotes
*
* ### Example
*
* ```
* router.navigate(['team', 33, 'user', 11], {relativeTo: route});

View File

@ -225,6 +225,7 @@ export function provideForRootGuard(router: Router): any {
*
* Registers routes.
*
* @usageNotes
* ### Example
*
* ```

View File

@ -26,6 +26,7 @@ import {Tree, TreeNode} from './utils/tree';
* RouterState is a tree of activated routes. Every node in this tree knows about the "consumed" URL
* segments, the extracted parameters, and the resolved data.
*
* @usageNotes
* ### Example
*
* ```
@ -340,6 +341,7 @@ export class ActivatedRouteSnapshot {
* This is a tree of activated route snapshots. Every node in this tree knows about
* the "consumed" URL segments, the extracted parameters, and the resolved data.
*
* @usageNotes
* ### Example
*
* ```

View File

@ -82,6 +82,7 @@ function containsSegmentGroupHelper(
* serialized tree.
* UrlTree is a data structure that provides a lot of affordances in dealing with URLs
*
* @usageNotes
* ### Example
*
* ```
@ -173,7 +174,8 @@ export class UrlSegmentGroup {
* A UrlSegment is a part of a URL between the two slashes. It contains a path and the matrix
* parameters associated with the segment.
*
* ## Example
* @usageNotes
* ### Example
*
* ```
* @Component({templateUrl:'template.html'})

View File

@ -147,6 +147,7 @@ export function setupTestingRouter(
* It provides spy implementations of `Location`, `LocationStrategy`, and {@link
* NgModuleFactoryLoader}.
*
* @usageNotes
* ### Example
*
* ```