Skip to content
Permalink
Browse files

feat(router): export RouterLink and RouterOutlet (#8912)

Makes it possible to individually import RouterLink and RouterOutlet from the router module
  • Loading branch information...
hannahhoward authored and mhevery committed Jun 1, 2016
1 parent f2809d1 commit 1c929031a2c233cac734a227b8fe74b7ba5f4db7
@@ -498,6 +498,8 @@ var ROUTER: string[] = [
'ROUTER_PROVIDERS',
'Route',
'Router',
'RouterOutlet',
'RouterLink',
'DefaultRouterUrlSerializer',
'RouteSegment',
'RouteTree',
@@ -12,27 +12,6 @@ export {RouterUrlSerializer, DefaultRouterUrlSerializer} from './src/router_url_
export {OnActivate, CanDeactivate} from './src/interfaces';
export {ROUTER_PROVIDERS} from './src/router_providers';

import {RouterOutlet} from './src/directives/router_outlet';
import {RouterLink} from './src/directives/router_link';

/**
* A list of directives. To use the router directives like {@link RouterOutlet} and
* {@link RouterLink}, add this to your `directives` array in the {@link View} decorator of your
* component.
*
* ```
* import {Component} from '@angular/core';
* import {ROUTER_DIRECTIVES, Routes} from '@angular/router';
*
* @Component({directives: [ROUTER_DIRECTIVES]})
* @Routes([
* {...},
* ])
* class AppCmp {
* // ...
* }
*
* bootstrap(AppCmp);
* ```
*/
export const ROUTER_DIRECTIVES: any[] = /*@ts2dart_const*/[RouterOutlet, RouterLink];
export {RouterOutlet} from './src/directives/router_outlet';
export {RouterLink} from './src/directives/router_link';
export {ROUTER_DIRECTIVES} from "./src/directives/router_directives";
@@ -0,0 +1,25 @@
import {RouterOutlet} from "./router_outlet";
import {RouterLink} from "./router_link";

/**
* A list of directives. To use the router directives like {@link RouterOutlet} and
* {@link RouterLink}, add this to your `directives` array in the {@link View} decorator of your
* component.
*
* ```
* import {Component} from '@angular/core';
* import {ROUTER_DIRECTIVES, Routes} from '@angular/router';
*
* @Component({directives: [ROUTER_DIRECTIVES]})
* @Routes([
* {...},
* ])
* class AppCmp {
* // ...
* }
*
* bootstrap(AppCmp);
* ```
*/

export const ROUTER_DIRECTIVES: any[] = /*@ts2dart_const*/[RouterOutlet, RouterLink];

0 comments on commit 1c92903

Please sign in to comment.
You can’t perform that action at this time.