Skip to content

Commit 3784696

Browse files
committed
fix(router): make the contstructor of the router service public
1 parent 8c45aeb commit 3784696

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

modules/@angular/router/src/directives/router_link.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ import {UrlTree} from '../url_tree';
5656
*/
5757
@Directive({selector: ':not(a)[routerLink]'})
5858
export class RouterLink {
59-
@Input() target: string;
6059
private commands: any[] = [];
6160
@Input() queryParams: {[k: string]: any};
6261
@Input() fragment: string;
@@ -73,7 +72,7 @@ export class RouterLink {
7372
@Input()
7473
set routerLink(data: any[]|string) {
7574
if (Array.isArray(data)) {
76-
this.commands = <any>data;
75+
this.commands = data;
7776
} else {
7877
this.commands = [data];
7978
}
@@ -85,10 +84,6 @@ export class RouterLink {
8584
return true;
8685
}
8786

88-
if (typeof this.target === 'string' && this.target != '_self') {
89-
return true;
90-
}
91-
9287
this.router.navigate(
9388
this.commands,
9489
{relativeTo: this.route, queryParams: this.queryParams, fragment: this.fragment});
@@ -122,7 +117,7 @@ export class RouterLinkWithHref implements OnChanges {
122117
@Input()
123118
set routerLink(data: any[]|string) {
124119
if (Array.isArray(data)) {
125-
this.commands = <any>data;
120+
this.commands = data;
126121
} else {
127122
this.commands = [data];
128123
}

modules/@angular/router/src/router.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export class Router {
125125
private config: RouterConfig;
126126

127127
/**
128-
* @internal
128+
* Creates the router service.
129129
*/
130130
constructor(
131131
private rootComponentType: Type, private resolver: ComponentResolver,

tools/public_api_guard/router/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export declare class Router {
114114
events: Observable<Event>;
115115
routerState: RouterState;
116116
url: string;
117+
constructor(rootComponentType: Type, resolver: ComponentResolver, urlSerializer: UrlSerializer, outletMap: RouterOutletMap, location: Location, injector: Injector, config: RouterConfig);
117118
createUrlTree(commands: any[], {relativeTo, queryParams, fragment}?: NavigationExtras): UrlTree;
118119
navigate(commands: any[], extras?: NavigationExtras): Promise<boolean>;
119120
navigateByUrl(url: string | UrlTree): Promise<boolean>;

0 commit comments

Comments
 (0)