docs(router): Fixed examples for router.navigate (#11263)

This commit is contained in:
Brandon 2016-09-02 15:42:51 -05:00 committed by Martin Probst
parent 5e5ae3cde6
commit f5101782d9

View File

@ -69,7 +69,7 @@ export interface NavigationExtras {
* constructor(private router: Router, private route: ActivatedRoute) {} * constructor(private router: Router, private route: ActivatedRoute) {}
* *
* go() { * go() {
* this.router.navigate('../list', { relativeTo: this.route }); * this.router.navigate(['../list'], { relativeTo: this.route });
* } * }
* } * }
* ``` * ```
@ -80,7 +80,7 @@ export interface NavigationExtras {
* *
* ``` * ```
* // Navigate to /results?page=1 * // Navigate to /results?page=1
* this.router.navigate('/results', { queryParams: { page: 1 } }); * this.router.navigate(['/results'], { queryParams: { page: 1 } });
* ``` * ```
*/ */
queryParams?: Params; queryParams?: Params;
@ -89,7 +89,7 @@ export interface NavigationExtras {
* *
* ``` * ```
* // Navigate to /results#top * // Navigate to /results#top
* this.router.navigate('/results', { fragment: 'top' }); * this.router.navigate(['/results'], { fragment: 'top' });
* ``` * ```
*/ */
fragment?: string; fragment?: string;
@ -98,7 +98,7 @@ export interface NavigationExtras {
* *
* ``` * ```
* // Preserve query params from /results?page=1 to /view?page=1 * // Preserve query params from /results?page=1 to /view?page=1
* this.router.navigate('/view', { preserveQueryParams: true }); * this.router.navigate(['/view'], { preserveQueryParams: true });
* ``` * ```
*/ */
preserveQueryParams?: boolean; preserveQueryParams?: boolean;
@ -107,7 +107,7 @@ export interface NavigationExtras {
* *
* ``` * ```
* // Preserve fragment from /results#top to /view#top * // Preserve fragment from /results#top to /view#top
* this.router.navigate('/view', { preserveFragment: true }); * this.router.navigate(['/view'], { preserveFragment: true });
* ``` * ```
*/ */
preserveFragment?: boolean; preserveFragment?: boolean;
@ -116,7 +116,7 @@ export interface NavigationExtras {
* *
* ``` * ```
* // Navigate silently to /view * // Navigate silently to /view
* this.router.navigate('/view', { skipLocationChange: true }); * this.router.navigate(['/view'], { skipLocationChange: true });
* ``` * ```
*/ */
skipLocationChange?: boolean; skipLocationChange?: boolean;
@ -125,7 +125,7 @@ export interface NavigationExtras {
* *
* ``` * ```
* // Navigate to /view * // Navigate to /view
* this.router.navigate('/view', { replaceUrl: true }); * this.router.navigate(['/view'], { replaceUrl: true });
* ``` * ```
*/ */
replaceUrl?: boolean; replaceUrl?: boolean;