cleanup(router): add @internal to constructors where needed

This commit is contained in:
vsavkin 2016-06-02 15:18:34 -07:00
parent ab958598d7
commit f04b6978fb
4 changed files with 27 additions and 4 deletions

View File

@ -40,6 +40,9 @@ export class RouterLink {
// the url displayed on the anchor element.
@HostBinding() href: string;
/**
* @internal
*/
constructor(private router: Router, private route: ActivatedRoute) {}
@Input()
@ -52,7 +55,6 @@ export class RouterLink {
this.updateTargetUrlAndHref();
}
@HostListener("click")
onClick(): boolean {
// If no target, or if target is _self, prevent default browser behavior

View File

@ -7,8 +7,11 @@ export class RouterOutlet {
private activated:ComponentRef<any>|null;
public outletMap:RouterOutletMap;
/**
* @internal
*/
constructor(parentOutletMap:RouterOutletMap, private location:ViewContainerRef,
@Attribute('name') name:string, public injector: Injector) {
@Attribute('name') name:string) {
parentOutletMap.registerOutlet(name ? name : PRIMARY_OUTLET, this);
}
@ -28,7 +31,7 @@ export class RouterOutlet {
activate(factory: ComponentFactory<any>, providers: ResolvedReflectiveProvider[],
outletMap: RouterOutletMap): void {
this.outletMap = outletMap;
let inj = ReflectiveInjector.fromResolvedProviders(providers, this.location.parentInjector);
const inj = ReflectiveInjector.fromResolvedProviders(providers, this.location.parentInjector);
this.activated = this.location.createComponent(factory, this.location.length, inj, []);
}
}

View File

@ -23,6 +23,9 @@ import { Type, ComponentFactory } from '@angular/core';
* ```
*/
export class RouterState extends Tree<ActivatedRoute> {
/**
* @internal
*/
constructor(root: TreeNode<ActivatedRoute>, public queryParams: Observable<Params>, public fragment: Observable<string>, public snapshot: RouterStateSnapshot) {
super(root);
}
@ -68,6 +71,9 @@ export class ActivatedRoute {
_futureSnapshot: ActivatedRouteSnapshot;
snapshot: ActivatedRouteSnapshot;
/**
* @internal
*/
constructor(public urlSegments: Observable<UrlSegment[]>,
public params: Observable<Params>,
public outlet: string,
@ -103,6 +109,9 @@ export class ActivatedRouteSnapshot {
/** @internal **/
_lastUrlSegment: UrlSegment;
/**
* @internal
*/
constructor(public urlSegments: UrlSegment[],
public params: Params,
public outlet: string,
@ -128,6 +137,9 @@ export class ActivatedRouteSnapshot {
* ```
*/
export class RouterStateSnapshot extends Tree<ActivatedRouteSnapshot> {
/**
* @internal
*/
constructor(root: TreeNode<ActivatedRouteSnapshot>, public queryParams: Params, public fragment: string | null) {
super(root);
}

View File

@ -10,12 +10,18 @@ export function createEmptyUrlTree() {
* A URL in the tree form.
*/
export class UrlTree extends Tree<UrlSegment> {
/**
* @internal
*/
constructor(root: TreeNode<UrlSegment>, public queryParameters: {[key: string]: string}, public fragment: string | null) {
super(root);
}
}
export class UrlSegment {
/**
* @internal
*/
constructor(public path: string, public parameters: {[key: string]: string}, public outlet: string) {}
toString() {