fix(router): make the contstructor of the router service public
This commit is contained in:
parent
8c45aebc18
commit
3784696b9e
|
@ -56,7 +56,6 @@ import {UrlTree} from '../url_tree';
|
|||
*/
|
||||
@Directive({selector: ':not(a)[routerLink]'})
|
||||
export class RouterLink {
|
||||
@Input() target: string;
|
||||
private commands: any[] = [];
|
||||
@Input() queryParams: {[k: string]: any};
|
||||
@Input() fragment: string;
|
||||
|
@ -73,7 +72,7 @@ export class RouterLink {
|
|||
@Input()
|
||||
set routerLink(data: any[]|string) {
|
||||
if (Array.isArray(data)) {
|
||||
this.commands = <any>data;
|
||||
this.commands = data;
|
||||
} else {
|
||||
this.commands = [data];
|
||||
}
|
||||
|
@ -85,10 +84,6 @@ export class RouterLink {
|
|||
return true;
|
||||
}
|
||||
|
||||
if (typeof this.target === 'string' && this.target != '_self') {
|
||||
return true;
|
||||
}
|
||||
|
||||
this.router.navigate(
|
||||
this.commands,
|
||||
{relativeTo: this.route, queryParams: this.queryParams, fragment: this.fragment});
|
||||
|
@ -122,7 +117,7 @@ export class RouterLinkWithHref implements OnChanges {
|
|||
@Input()
|
||||
set routerLink(data: any[]|string) {
|
||||
if (Array.isArray(data)) {
|
||||
this.commands = <any>data;
|
||||
this.commands = data;
|
||||
} else {
|
||||
this.commands = [data];
|
||||
}
|
||||
|
|
|
@ -125,7 +125,7 @@ export class Router {
|
|||
private config: RouterConfig;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* Creates the router service.
|
||||
*/
|
||||
constructor(
|
||||
private rootComponentType: Type, private resolver: ComponentResolver,
|
||||
|
|
|
@ -114,6 +114,7 @@ export declare class Router {
|
|||
events: Observable<Event>;
|
||||
routerState: RouterState;
|
||||
url: string;
|
||||
constructor(rootComponentType: Type, resolver: ComponentResolver, urlSerializer: UrlSerializer, outletMap: RouterOutletMap, location: Location, injector: Injector, config: RouterConfig);
|
||||
createUrlTree(commands: any[], {relativeTo, queryParams, fragment}?: NavigationExtras): UrlTree;
|
||||
navigate(commands: any[], extras?: NavigationExtras): Promise<boolean>;
|
||||
navigateByUrl(url: string | UrlTree): Promise<boolean>;
|
||||
|
|
Loading…
Reference in New Issue