Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(router): export RouterLink and RouterOutlet #8912

Merged
merged 1 commit into from Jun 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions modules/@angular/integration_test/public_api_spec.ts
Expand Up @@ -496,6 +496,8 @@ var ROUTER: string[] = [
'ROUTER_PROVIDERS',
'Route',
'Router',
'RouterOutlet',
'RouterLink',
'DefaultRouterUrlSerializer',
'RouteSegment',
'RouteTree',
Expand Down
27 changes: 3 additions & 24 deletions modules/@angular/router/index.ts
Expand Up @@ -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";
25 changes: 25 additions & 0 deletions modules/@angular/router/src/directives/router_directives.ts
@@ -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];