From 51e661eb74277a096bc47a2b23849cd92d835351 Mon Sep 17 00:00:00 2001 From: vsavkin Date: Mon, 18 Jul 2016 16:42:33 -0700 Subject: [PATCH] fix(router): export navigation extras --- modules/@angular/router/index.ts | 2 +- modules/@angular/router/src/directives/router_outlet.ts | 3 ++- modules/@angular/router/src/router.ts | 3 +++ tools/public_api_guard/router/index.d.ts | 7 +++++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/@angular/router/index.ts b/modules/@angular/router/index.ts index 6e21a68b73..7ef0315d0e 100644 --- a/modules/@angular/router/index.ts +++ b/modules/@angular/router/index.ts @@ -13,7 +13,7 @@ export {RouterLink, RouterLinkWithHref} from './src/directives/router_link'; export {RouterLinkActive} from './src/directives/router_link_active'; export {RouterOutlet} from './src/directives/router_outlet'; export {CanActivate, CanActivateChild, CanDeactivate, Resolve} from './src/interfaces'; -export {Event, NavigationCancel, NavigationEnd, NavigationError, NavigationStart, Router, RoutesRecognized} from './src/router'; +export {Event, NavigationCancel, NavigationEnd, NavigationError, NavigationExtras, NavigationStart, Router, RoutesRecognized} from './src/router'; export {ROUTER_DIRECTIVES, RouterModule} from './src/router_module'; export {RouterOutletMap} from './src/router_outlet_map'; export {provideRouter} from './src/router_providers'; diff --git a/modules/@angular/router/src/directives/router_outlet.ts b/modules/@angular/router/src/directives/router_outlet.ts index f394c9c4bd..48fa44b4ed 100644 --- a/modules/@angular/router/src/directives/router_outlet.ts +++ b/modules/@angular/router/src/directives/router_outlet.ts @@ -6,13 +6,14 @@ * found in the LICENSE file at https://angular.io/license */ -import {Attribute, ComponentFactory, ComponentFactoryResolver, ComponentRef, Directive, EventEmitter, NoComponentFactoryError, Output, ReflectiveInjector, ResolvedReflectiveProvider, ViewContainerRef, Injector} from '@angular/core'; +import {Attribute, ComponentFactory, ComponentFactoryResolver, ComponentRef, Directive, EventEmitter, Injector, NoComponentFactoryError, Output, ReflectiveInjector, ResolvedReflectiveProvider, ViewContainerRef} from '@angular/core'; import {RouterOutletMap} from '../router_outlet_map'; import {ActivatedRoute} from '../router_state'; import {PRIMARY_OUTLET} from '../shared'; + /** * A router outlet is a placeholder that Angular dynamically fills based on the application's route. * diff --git a/modules/@angular/router/src/router.ts b/modules/@angular/router/src/router.ts index 2c19452f49..913ad39a1a 100644 --- a/modules/@angular/router/src/router.ts +++ b/modules/@angular/router/src/router.ts @@ -38,6 +38,9 @@ import {TreeNode} from './utils/tree'; declare var Zone: any; +/** + * @experimental + */ export interface NavigationExtras { relativeTo?: ActivatedRoute; queryParams?: Params; diff --git a/tools/public_api_guard/router/index.d.ts b/tools/public_api_guard/router/index.d.ts index e85a3bbe62..40cec17341 100644 --- a/tools/public_api_guard/router/index.d.ts +++ b/tools/public_api_guard/router/index.d.ts @@ -79,6 +79,13 @@ export declare class NavigationError { toString(): string; } +/** @experimental */ +export interface NavigationExtras { + fragment?: string; + queryParams?: Params; + relativeTo?: ActivatedRoute; +} + /** @stable */ export declare class NavigationStart { id: number;