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

Makes it possible to individually import RouterLink and RouterOutlet from the router module
This commit is contained in:
Hannah Howard
2016-06-01 09:48:55 -07:00
committed by Miško Hevery
parent f2809d1ed8
commit 1c929031a2
3 changed files with 30 additions and 24 deletions

View File

@ -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];