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]'})
|
@Directive({selector: ':not(a)[routerLink]'})
|
||||||
export class RouterLink {
|
export class RouterLink {
|
||||||
@Input() target: string;
|
|
||||||
private commands: any[] = [];
|
private commands: any[] = [];
|
||||||
@Input() queryParams: {[k: string]: any};
|
@Input() queryParams: {[k: string]: any};
|
||||||
@Input() fragment: string;
|
@Input() fragment: string;
|
||||||
|
@ -73,7 +72,7 @@ export class RouterLink {
|
||||||
@Input()
|
@Input()
|
||||||
set routerLink(data: any[]|string) {
|
set routerLink(data: any[]|string) {
|
||||||
if (Array.isArray(data)) {
|
if (Array.isArray(data)) {
|
||||||
this.commands = <any>data;
|
this.commands = data;
|
||||||
} else {
|
} else {
|
||||||
this.commands = [data];
|
this.commands = [data];
|
||||||
}
|
}
|
||||||
|
@ -85,10 +84,6 @@ export class RouterLink {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof this.target === 'string' && this.target != '_self') {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.router.navigate(
|
this.router.navigate(
|
||||||
this.commands,
|
this.commands,
|
||||||
{relativeTo: this.route, queryParams: this.queryParams, fragment: this.fragment});
|
{relativeTo: this.route, queryParams: this.queryParams, fragment: this.fragment});
|
||||||
|
@ -122,7 +117,7 @@ export class RouterLinkWithHref implements OnChanges {
|
||||||
@Input()
|
@Input()
|
||||||
set routerLink(data: any[]|string) {
|
set routerLink(data: any[]|string) {
|
||||||
if (Array.isArray(data)) {
|
if (Array.isArray(data)) {
|
||||||
this.commands = <any>data;
|
this.commands = data;
|
||||||
} else {
|
} else {
|
||||||
this.commands = [data];
|
this.commands = [data];
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,7 +125,7 @@ export class Router {
|
||||||
private config: RouterConfig;
|
private config: RouterConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* Creates the router service.
|
||||||
*/
|
*/
|
||||||
constructor(
|
constructor(
|
||||||
private rootComponentType: Type, private resolver: ComponentResolver,
|
private rootComponentType: Type, private resolver: ComponentResolver,
|
||||||
|
|
|
@ -114,6 +114,7 @@ export declare class Router {
|
||||||
events: Observable<Event>;
|
events: Observable<Event>;
|
||||||
routerState: RouterState;
|
routerState: RouterState;
|
||||||
url: string;
|
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;
|
createUrlTree(commands: any[], {relativeTo, queryParams, fragment}?: NavigationExtras): UrlTree;
|
||||||
navigate(commands: any[], extras?: NavigationExtras): Promise<boolean>;
|
navigate(commands: any[], extras?: NavigationExtras): Promise<boolean>;
|
||||||
navigateByUrl(url: string | UrlTree): Promise<boolean>;
|
navigateByUrl(url: string | UrlTree): Promise<boolean>;
|
||||||
|
|
Loading…
Reference in New Issue