1 | import { Location } from '@angular/common';
|
2 | import { Router } from '../router';
|
3 | /**
|
4 | * The RouterLink directive lets you link to specific parts of your app.
|
5 | *
|
6 | * Consider the following route configuration:
|
7 |
|
8 | * ```
|
9 | * @RouteConfig([
|
10 | * { path: '/user', component: UserCmp, name: 'User' }
|
11 | * ]);
|
12 | * class MyComp {}
|
13 | * ```
|
14 | *
|
15 | * When linking to this `User` route, you can write:
|
16 | *
|
17 | * ```
|
18 | * <a [routerLink]="['./User']">link to user component</a>
|
19 | * ```
|
20 | *
|
21 | * RouterLink expects the value to be an array of route names, followed by the params
|
22 | * for that level of routing. For instance `['/Team', {teamId: 1}, 'User', {userId: 2}]`
|
23 | * means that we want to generate a link for the `Team` route with params `{teamId: 1}`,
|
24 | * and with a child route `User` with params `{userId: 2}`.
|
25 | *
|
26 | * The first route name should be prepended with `/`, `./`, or `../`.
|
27 | * If the route begins with `/`, the router will look up the route from the root of the app.
|
28 | * If the route begins with `./`, the router will instead look in the current component's
|
29 | * children for the route. And if the route begins with `../`, the router will look at the
|
30 | * current component's parent.
|
31 | */
|
32 | export declare class RouterLink {
|
33 | private _router;
|
34 | private _location;
|
35 | private _routeParams;
|
36 | visibleHref: string;
|
37 | target: string;
|
38 | private _navigationInstruction;
|
39 | constructor(_router: Router, _location: Location);
|
40 | private _updateLink();
|
41 | isRouteActive: boolean;
|
42 | routeParams: any[];
|
43 | onClick(): boolean;
|
44 | }
|