refactor(TypeScript): Add noImplicitAny
We automatically insert explicit 'any's where needed. These need to be addressed as in #9100. Fixes #4924
This commit is contained in:
@ -39,7 +39,7 @@ function _normalizeCommands(commands: any[]): _NormalizedNavigationCommands {
|
||||
|
||||
let numberOfDoubleDots = 0;
|
||||
let isAbsolute = false;
|
||||
let res = [];
|
||||
let res: any[] /** TODO #9100 */ = [];
|
||||
|
||||
for (let i = 0; i < commands.length; ++i) {
|
||||
let c = commands[i];
|
||||
@ -167,7 +167,7 @@ function _update(node: TreeNode<UrlSegment>, commands: any[]): TreeNode<UrlSegme
|
||||
|
||||
function _stringify(params: {[key: string]: any}): {[key: string]: string} {
|
||||
let res = {};
|
||||
StringMapWrapper.forEach(params, (v, k) => res[k] = v.toString());
|
||||
StringMapWrapper.forEach(params, (v: any /** TODO #9100 */, k: any /** TODO #9100 */) => (res as any /** TODO #9100 */)[k] = v.toString());
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ function _recognize(componentResolver: ComponentResolver, parentComponent: Type,
|
||||
`Component '${stringify(parentComponent)}' does not have route configuration`);
|
||||
}
|
||||
|
||||
let match;
|
||||
let match: any /** TODO #9100 */;
|
||||
try {
|
||||
match = _match(metadata, url);
|
||||
} catch (e) {
|
||||
@ -146,7 +146,7 @@ function _matchWithParts(route: RouteMetadata, url: TreeNode<UrlSegment>): _Matc
|
||||
|
||||
let parts = path.split("/");
|
||||
let positionalParams = {};
|
||||
let consumedUrlSegments = [];
|
||||
let consumedUrlSegments: any[] /** TODO #9100 */ = [];
|
||||
|
||||
let lastParent: TreeNode<UrlSegment> = null;
|
||||
let lastSegment: TreeNode<UrlSegment> = null;
|
||||
@ -169,7 +169,7 @@ function _matchWithParts(route: RouteMetadata, url: TreeNode<UrlSegment>): _Matc
|
||||
}
|
||||
|
||||
if (isPosParam) {
|
||||
positionalParams[p.substring(1)] = current.value.segment;
|
||||
(positionalParams as any /** TODO #9100 */)[p.substring(1)] = current.value.segment;
|
||||
}
|
||||
|
||||
consumedUrlSegments.push(current.value);
|
||||
@ -188,13 +188,13 @@ function _matchWithParts(route: RouteMetadata, url: TreeNode<UrlSegment>): _Matc
|
||||
function _checkOutletNameUniqueness(nodes: TreeNode<RouteSegment>[]): TreeNode<RouteSegment>[] {
|
||||
let names = {};
|
||||
nodes.forEach(n => {
|
||||
let segmentWithSameOutletName = names[n.value.outlet];
|
||||
let segmentWithSameOutletName = (names as any /** TODO #9100 */)[n.value.outlet];
|
||||
if (isPresent(segmentWithSameOutletName)) {
|
||||
let p = segmentWithSameOutletName.stringifiedUrlSegments;
|
||||
let c = n.value.stringifiedUrlSegments;
|
||||
throw new BaseException(`Two segments cannot have the same outlet name: '${p}' and '${c}'.`);
|
||||
}
|
||||
names[n.value.outlet] = n.value;
|
||||
(names as any /** TODO #9100 */)[n.value.outlet] = n.value;
|
||||
});
|
||||
return nodes;
|
||||
}
|
||||
|
@ -219,19 +219,19 @@ class _ActivateSegments {
|
||||
let prevChildren = isPresent(prevNode) ?
|
||||
prevNode.children.reduce(
|
||||
(m, c) => {
|
||||
m[c.value.outlet] = c;
|
||||
(m as any /** TODO #9100 */)[c.value.outlet] = c;
|
||||
return m;
|
||||
},
|
||||
{}) :
|
||||
{};
|
||||
|
||||
currNode.children.forEach(c => {
|
||||
this.activateSegments(c, prevChildren[c.value.outlet], outletMap, components);
|
||||
this.activateSegments(c, (prevChildren as any /** TODO #9100 */)[c.value.outlet], outletMap, components);
|
||||
StringMapWrapper.delete(prevChildren, c.value.outlet);
|
||||
});
|
||||
|
||||
StringMapWrapper.forEach(prevChildren,
|
||||
(v, k) => this.deactivateOutlet(outletMap._outlets[k], components));
|
||||
(v: any /** TODO #9100 */, k: any /** TODO #9100 */) => this.deactivateOutlet(outletMap._outlets[k], components));
|
||||
}
|
||||
|
||||
activateSegments(currNode: TreeNode<RouteSegment>, prevNode: TreeNode<RouteSegment>,
|
||||
@ -279,7 +279,7 @@ class _ActivateSegments {
|
||||
private deactivateOutlet(outlet: RouterOutlet, components: Object[]): void {
|
||||
if (isPresent(outlet) && outlet.isActivated) {
|
||||
StringMapWrapper.forEach(outlet.outletMap._outlets,
|
||||
(v, k) => this.deactivateOutlet(v, components));
|
||||
(v: any /** TODO #9100 */, k: any /** TODO #9100 */) => this.deactivateOutlet(v, components));
|
||||
if (this.performMutation) {
|
||||
outlet.deactivate();
|
||||
} else {
|
||||
|
@ -108,7 +108,7 @@ class _UrlParser {
|
||||
matrixParams = this.parseMatrixParams();
|
||||
}
|
||||
|
||||
var aux = [];
|
||||
var aux: any[] /** TODO #9100 */ = [];
|
||||
if (this.peekStartsWith('(')) {
|
||||
aux = this.parseAuxiliaryRoutes();
|
||||
}
|
||||
@ -183,7 +183,7 @@ class _UrlParser {
|
||||
}
|
||||
|
||||
parseAuxiliaryRoutes(): TreeNode<UrlSegment>[] {
|
||||
var segments = [];
|
||||
var segments: any[] /** TODO #9100 */ = [];
|
||||
this.capture('(');
|
||||
|
||||
while (!this.peekStartsWith(')') && this._remaining.length > 0) {
|
||||
|
@ -92,7 +92,7 @@ export class UrlSegment {
|
||||
|
||||
function _serializeParams(params: {[key: string]: string}): string {
|
||||
let res = "";
|
||||
StringMapWrapper.forEach(params, (v, k) => res += `;${k}=${v}`);
|
||||
StringMapWrapper.forEach(params, (v: any /** TODO #9100 */, k: any /** TODO #9100 */) => res += `;${k}=${v}`);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -39,17 +39,17 @@ export function main() {
|
||||
{provide: RouterUrlSerializer, useClass: DefaultRouterUrlSerializer},
|
||||
RouterOutletMap,
|
||||
{provide: Location, useClass: SpyLocation},
|
||||
{provide: RouteSegment, useFactory: (r) => r.routeTree.root, deps: [Router]},
|
||||
{provide: RouteSegment, useFactory: (r: any /** TODO #9100 */) => r.routeTree.root, deps: [Router]},
|
||||
{
|
||||
provide: Router,
|
||||
useFactory: (resolver, urlParser, outletMap, location) => new Router(
|
||||
useFactory: (resolver: any /** TODO #9100 */, urlParser: any /** TODO #9100 */, outletMap: any /** TODO #9100 */, location: any /** TODO #9100 */) => new Router(
|
||||
"RootComponent", RootCmp, resolver, urlParser, outletMap, location),
|
||||
deps: [ComponentResolver, RouterUrlSerializer, RouterOutletMap, Location]
|
||||
}
|
||||
]);
|
||||
|
||||
it('should update location when navigating',
|
||||
fakeAsync(inject([Router, TestComponentBuilder, Location], (router, tcb, location) => {
|
||||
fakeAsync(inject([Router, TestComponentBuilder, Location], (router: any /** TODO #9100 */, tcb: any /** TODO #9100 */, location: any /** TODO #9100 */) => {
|
||||
let fixture = tcb.createFakeAsync(RootCmp);
|
||||
|
||||
router.navigateByUrl('/team/22/user/victor');
|
||||
@ -63,7 +63,7 @@ export function main() {
|
||||
})));
|
||||
|
||||
it('should navigate back and forward',
|
||||
fakeAsync(inject([Router, TestComponentBuilder, Location], (router, tcb, location) => {
|
||||
fakeAsync(inject([Router, TestComponentBuilder, Location], (router: any /** TODO #9100 */, tcb: any /** TODO #9100 */, location: any /** TODO #9100 */) => {
|
||||
let fixture = tcb.createFakeAsync(RootCmp);
|
||||
|
||||
router.navigateByUrl('/team/33/simple');
|
||||
@ -82,7 +82,7 @@ export function main() {
|
||||
})));
|
||||
|
||||
it('should navigate when locations changes',
|
||||
fakeAsync(inject([Router, TestComponentBuilder, Location], (router, tcb, location) => {
|
||||
fakeAsync(inject([Router, TestComponentBuilder, Location], (router: any /** TODO #9100 */, tcb: any /** TODO #9100 */, location: any /** TODO #9100 */) => {
|
||||
let fixture = tcb.createFakeAsync(RootCmp);
|
||||
|
||||
router.navigateByUrl('/team/22/user/victor');
|
||||
@ -95,7 +95,7 @@ export function main() {
|
||||
})));
|
||||
|
||||
it('should support nested routes',
|
||||
fakeAsync(inject([Router, TestComponentBuilder], (router, tcb) => {
|
||||
fakeAsync(inject([Router, TestComponentBuilder], (router: any /** TODO #9100 */, tcb: any /** TODO #9100 */) => {
|
||||
let fixture = tcb.createFakeAsync(RootCmp);
|
||||
|
||||
router.navigateByUrl('/team/22/user/victor');
|
||||
@ -105,7 +105,7 @@ export function main() {
|
||||
})));
|
||||
|
||||
it('should support aux routes',
|
||||
fakeAsync(inject([Router, TestComponentBuilder], (router, tcb) => {
|
||||
fakeAsync(inject([Router, TestComponentBuilder], (router: any /** TODO #9100 */, tcb: any /** TODO #9100 */) => {
|
||||
let fixture = tcb.createFakeAsync(RootCmp);
|
||||
|
||||
router.navigateByUrl('/team/22/user/victor(/simple)');
|
||||
@ -116,7 +116,7 @@ export function main() {
|
||||
})));
|
||||
|
||||
it('should deactivate outlets',
|
||||
fakeAsync(inject([Router, TestComponentBuilder], (router, tcb) => {
|
||||
fakeAsync(inject([Router, TestComponentBuilder], (router: any /** TODO #9100 */, tcb: any /** TODO #9100 */) => {
|
||||
let fixture = tcb.createFakeAsync(RootCmp);
|
||||
|
||||
router.navigateByUrl('/team/22/user/victor(/simple)');
|
||||
@ -129,7 +129,7 @@ export function main() {
|
||||
})));
|
||||
|
||||
it('should deactivate nested outlets',
|
||||
fakeAsync(inject([Router, TestComponentBuilder], (router, tcb) => {
|
||||
fakeAsync(inject([Router, TestComponentBuilder], (router: any /** TODO #9100 */, tcb: any /** TODO #9100 */) => {
|
||||
let fixture = tcb.createFakeAsync(RootCmp);
|
||||
|
||||
router.navigateByUrl('/team/22/user/victor(/simple)');
|
||||
@ -142,7 +142,7 @@ export function main() {
|
||||
})));
|
||||
|
||||
it('should update nested routes when url changes',
|
||||
fakeAsync(inject([Router, TestComponentBuilder], (router, tcb) => {
|
||||
fakeAsync(inject([Router, TestComponentBuilder], (router: any /** TODO #9100 */, tcb: any /** TODO #9100 */) => {
|
||||
let fixture = tcb.createFakeAsync(RootCmp);
|
||||
|
||||
router.navigateByUrl('/team/22/user/victor');
|
||||
@ -158,7 +158,7 @@ export function main() {
|
||||
})));
|
||||
|
||||
it('should not deactivate the route if can deactivate returns false',
|
||||
fakeAsync(inject([Router, TestComponentBuilder, Location], (router, tcb, location) => {
|
||||
fakeAsync(inject([Router, TestComponentBuilder, Location], (router: any /** TODO #9100 */, tcb: any /** TODO #9100 */, location: any /** TODO #9100 */) => {
|
||||
let fixture = tcb.createFakeAsync(RootCmp);
|
||||
|
||||
router.navigateByUrl('/team/22/cannotDeactivate');
|
||||
@ -175,7 +175,7 @@ export function main() {
|
||||
|
||||
if (getDOM().supportsDOMEvents()) {
|
||||
it("should support absolute router links",
|
||||
fakeAsync(inject([Router, TestComponentBuilder], (router, tcb) => {
|
||||
fakeAsync(inject([Router, TestComponentBuilder], (router: any /** TODO #9100 */, tcb: any /** TODO #9100 */) => {
|
||||
let fixture = tcb.createFakeAsync(RootCmp);
|
||||
advance(fixture);
|
||||
|
||||
@ -192,7 +192,7 @@ export function main() {
|
||||
})));
|
||||
|
||||
it("should support relative router links",
|
||||
fakeAsync(inject([Router, TestComponentBuilder], (router, tcb) => {
|
||||
fakeAsync(inject([Router, TestComponentBuilder], (router: any /** TODO #9100 */, tcb: any /** TODO #9100 */) => {
|
||||
let fixture = tcb.createFakeAsync(RootCmp);
|
||||
advance(fixture);
|
||||
|
||||
@ -211,7 +211,7 @@ export function main() {
|
||||
})));
|
||||
|
||||
it("should set the router-link-active class",
|
||||
fakeAsync(inject([Router, TestComponentBuilder], (router, tcb) => {
|
||||
fakeAsync(inject([Router, TestComponentBuilder], (router: any /** TODO #9100 */, tcb: any /** TODO #9100 */) => {
|
||||
let fixture = tcb.createFakeAsync(RootCmp);
|
||||
advance(fixture);
|
||||
|
||||
@ -229,7 +229,7 @@ export function main() {
|
||||
})));
|
||||
|
||||
it("should update router links when router changes",
|
||||
fakeAsync(inject([Router, TestComponentBuilder], (router, tcb) => {
|
||||
fakeAsync(inject([Router, TestComponentBuilder], (router: any /** TODO #9100 */, tcb: any /** TODO #9100 */) => {
|
||||
let fixture = tcb.createFakeAsync(RootCmp);
|
||||
advance(fixture);
|
||||
|
||||
@ -247,14 +247,14 @@ export function main() {
|
||||
})));
|
||||
|
||||
it("should support top-level link",
|
||||
fakeAsync(inject([Router, TestComponentBuilder], (router, tcb) => {
|
||||
fakeAsync(inject([Router, TestComponentBuilder], (router: any /** TODO #9100 */, tcb: any /** TODO #9100 */) => {
|
||||
let fixture = tcb.createFakeAsync(LinkCmp);
|
||||
advance(fixture);
|
||||
expect(fixture.debugElement.nativeElement).toHaveText('link');
|
||||
})));
|
||||
|
||||
it('should replace state when path is equal to current path',
|
||||
fakeAsync(inject([Router, TestComponentBuilder, Location], (router, tcb, location) => {
|
||||
fakeAsync(inject([Router, TestComponentBuilder, Location], (router: any /** TODO #9100 */, tcb: any /** TODO #9100 */, location: any /** TODO #9100 */) => {
|
||||
let fixture = tcb.createFakeAsync(RootCmp);
|
||||
|
||||
router.navigateByUrl('/team/33/simple');
|
||||
@ -286,12 +286,12 @@ function compileRoot(tcb: TestComponentBuilder): Promise<ComponentFixture<any>>
|
||||
@Component({selector: 'user-cmp', template: `hello {{user}}`})
|
||||
class UserCmp implements OnActivate {
|
||||
user: string;
|
||||
routerOnActivate(s: RouteSegment, a?, b?, c?) { this.user = s.getParam('name'); }
|
||||
routerOnActivate(s: RouteSegment, a?: any /** TODO #9100 */, b?: any /** TODO #9100 */, c?: any /** TODO #9100 */) { this.user = s.getParam('name'); }
|
||||
}
|
||||
|
||||
@Component({selector: 'cannot-deactivate', template: `cannotDeactivate`})
|
||||
class CanDeactivateCmp implements CanDeactivate {
|
||||
routerCanDeactivate(a?, b?): Promise<boolean> { return PromiseWrapper.resolve(false); }
|
||||
routerCanDeactivate(a?: any /** TODO #9100 */, b?: any /** TODO #9100 */): Promise<boolean> { return PromiseWrapper.resolve(false); }
|
||||
}
|
||||
|
||||
@Component({selector: 'simple-cmp', template: `simple`})
|
||||
@ -334,7 +334,7 @@ class RelativeLinkCmp {
|
||||
])
|
||||
class TeamCmp implements OnActivate {
|
||||
id: string;
|
||||
routerOnActivate(s: RouteSegment, a?, b?, c?) { this.id = s.getParam('id'); }
|
||||
routerOnActivate(s: RouteSegment, a?: any /** TODO #9100 */, b?: any /** TODO #9100 */, c?: any /** TODO #9100 */) { this.id = s.getParam('id'); }
|
||||
}
|
||||
|
||||
@Component({
|
||||
|
@ -24,7 +24,7 @@ export function main() {
|
||||
let emptyRouteTree = createEmptyRouteTree(ComponentA);
|
||||
|
||||
it('should handle position args',
|
||||
inject([AsyncTestCompleter, ComponentResolver], (async, resolver) => {
|
||||
inject([AsyncTestCompleter, ComponentResolver], (async: any /** TODO #9100 */, resolver: any /** TODO #9100 */) => {
|
||||
recognize(resolver, ComponentA, tree("b/paramB/c/paramC/d"), emptyRouteTree)
|
||||
.then(r => {
|
||||
let a = r.root;
|
||||
@ -48,7 +48,7 @@ export function main() {
|
||||
}));
|
||||
|
||||
it('should support empty routes',
|
||||
inject([AsyncTestCompleter, ComponentResolver], (async, resolver) => {
|
||||
inject([AsyncTestCompleter, ComponentResolver], (async: any /** TODO #9100 */, resolver: any /** TODO #9100 */) => {
|
||||
recognize(resolver, ComponentA, tree("f"), emptyRouteTree)
|
||||
.then(r => {
|
||||
let a = r.root;
|
||||
@ -68,7 +68,7 @@ export function main() {
|
||||
}));
|
||||
|
||||
it('should handle aux routes',
|
||||
inject([AsyncTestCompleter, ComponentResolver], (async, resolver) => {
|
||||
inject([AsyncTestCompleter, ComponentResolver], (async: any /** TODO #9100 */, resolver: any /** TODO #9100 */) => {
|
||||
recognize(resolver, ComponentA, tree("b/paramB(/d//right:d)"), emptyRouteTree)
|
||||
.then(r => {
|
||||
let c = r.children(r.root);
|
||||
@ -89,7 +89,7 @@ export function main() {
|
||||
}));
|
||||
|
||||
it("should error when two segments with the same outlet name",
|
||||
inject([AsyncTestCompleter, ComponentResolver], (async, resolver) => {
|
||||
inject([AsyncTestCompleter, ComponentResolver], (async: any /** TODO #9100 */, resolver: any /** TODO #9100 */) => {
|
||||
recognize(resolver, ComponentA, tree("b/paramB(right:d//right:e)"), emptyRouteTree)
|
||||
.catch(e => {
|
||||
expect(e.message).toEqual(
|
||||
@ -99,7 +99,7 @@ export function main() {
|
||||
}));
|
||||
|
||||
it('should handle nested aux routes',
|
||||
inject([AsyncTestCompleter, ComponentResolver], (async, resolver) => {
|
||||
inject([AsyncTestCompleter, ComponentResolver], (async: any /** TODO #9100 */, resolver: any /** TODO #9100 */) => {
|
||||
recognize(resolver, ComponentA, tree("b/paramB(/d(right:e))"), emptyRouteTree)
|
||||
.then(r => {
|
||||
let c = r.children(r.root);
|
||||
@ -120,7 +120,7 @@ export function main() {
|
||||
}));
|
||||
|
||||
it('should handle non top-level aux routes',
|
||||
inject([AsyncTestCompleter, ComponentResolver], (async, resolver) => {
|
||||
inject([AsyncTestCompleter, ComponentResolver], (async: any /** TODO #9100 */, resolver: any /** TODO #9100 */) => {
|
||||
recognize(resolver, ComponentA, tree('b/paramB/d(e)'), emptyRouteTree)
|
||||
.then(r => {
|
||||
let c = r.children(r.firstChild(r.root));
|
||||
@ -137,7 +137,7 @@ export function main() {
|
||||
}));
|
||||
|
||||
it('should handle matrix parameters',
|
||||
inject([AsyncTestCompleter, ComponentResolver], (async, resolver) => {
|
||||
inject([AsyncTestCompleter, ComponentResolver], (async: any /** TODO #9100 */, resolver: any /** TODO #9100 */) => {
|
||||
recognize(resolver, ComponentA, tree("b/paramB;b1=1;b2=2(/d;d1=1;d2=2)"), emptyRouteTree)
|
||||
.then(r => {
|
||||
let c = r.children(r.root);
|
||||
@ -149,7 +149,7 @@ export function main() {
|
||||
}));
|
||||
|
||||
it('should match a wildcard',
|
||||
inject([AsyncTestCompleter, ComponentResolver], (async, resolver) => {
|
||||
inject([AsyncTestCompleter, ComponentResolver], (async: any /** TODO #9100 */, resolver: any /** TODO #9100 */) => {
|
||||
recognize(resolver, ComponentG, tree("a;aa=1/b;bb=2"), emptyRouteTree)
|
||||
.then(r => {
|
||||
let c = r.children(r.root);
|
||||
@ -162,7 +162,7 @@ export function main() {
|
||||
}));
|
||||
|
||||
it('should error when no matching routes',
|
||||
inject([AsyncTestCompleter, ComponentResolver], (async, resolver) => {
|
||||
inject([AsyncTestCompleter, ComponentResolver], (async: any /** TODO #9100 */, resolver: any /** TODO #9100 */) => {
|
||||
recognize(resolver, ComponentA, tree("invalid"), emptyRouteTree)
|
||||
.catch(e => {
|
||||
expect(e.message).toContain("Cannot match any routes");
|
||||
@ -171,7 +171,7 @@ export function main() {
|
||||
}));
|
||||
|
||||
it('should handle no matching routes (too short)',
|
||||
inject([AsyncTestCompleter, ComponentResolver], (async, resolver) => {
|
||||
inject([AsyncTestCompleter, ComponentResolver], (async: any /** TODO #9100 */, resolver: any /** TODO #9100 */) => {
|
||||
recognize(resolver, ComponentA, tree("b"), emptyRouteTree)
|
||||
.catch(e => {
|
||||
expect(e.message).toContain("Cannot match any routes");
|
||||
@ -180,7 +180,7 @@ export function main() {
|
||||
}));
|
||||
|
||||
it("should error when a component doesn't have @Routes",
|
||||
inject([AsyncTestCompleter, ComponentResolver], (async, resolver) => {
|
||||
inject([AsyncTestCompleter, ComponentResolver], (async: any /** TODO #9100 */, resolver: any /** TODO #9100 */) => {
|
||||
recognize(resolver, ComponentA, tree("d/invalid"), emptyRouteTree)
|
||||
.catch(e => {
|
||||
expect(e.message)
|
||||
@ -190,7 +190,7 @@ export function main() {
|
||||
}));
|
||||
|
||||
it("should reuse existing segments",
|
||||
inject([AsyncTestCompleter, ComponentResolver], (async, resolver) => {
|
||||
inject([AsyncTestCompleter, ComponentResolver], (async: any /** TODO #9100 */, resolver: any /** TODO #9100 */) => {
|
||||
recognize(resolver, ComponentA, tree("/b/1/d"), emptyRouteTree)
|
||||
.then(t1 => {
|
||||
recognize(resolver, ComponentA, tree("/b/1/e"), t1)
|
||||
|
@ -38,20 +38,20 @@ export function main() {
|
||||
{provide: LocationStrategy, useClass: MockLocationStrategy},
|
||||
{
|
||||
provide: Router,
|
||||
useFactory: (resolver, urlParser, outletMap, location) => new Router(
|
||||
useFactory: (resolver: any /** TODO #9100 */, urlParser: any /** TODO #9100 */, outletMap: any /** TODO #9100 */, location: any /** TODO #9100 */) => new Router(
|
||||
"RootComponent", RootCmp, resolver, urlParser, outletMap, location),
|
||||
deps: [ComponentResolver, RouterUrlSerializer, RouterOutletMap, Location]
|
||||
}
|
||||
]);
|
||||
|
||||
describe("routerLink=", () => {
|
||||
it("should accept an array of commands", inject([Router, LocationStrategy], (router, locationStrategy) => {
|
||||
it("should accept an array of commands", inject([Router, LocationStrategy], (router: any /** TODO #9100 */, locationStrategy: any /** TODO #9100 */) => {
|
||||
let link = new RouterLink(null, router, locationStrategy);
|
||||
link.routerLink = ['/one', 11];
|
||||
expect(link.href).toEqual("/one/11");
|
||||
}));
|
||||
|
||||
it("should accept a single command", inject([Router, LocationStrategy], (router, locationStrategy) => {
|
||||
it("should accept a single command", inject([Router, LocationStrategy], (router: any /** TODO #9100 */, locationStrategy: any /** TODO #9100 */) => {
|
||||
let link = new RouterLink(null, router, locationStrategy);
|
||||
link.routerLink = '/one/11';
|
||||
expect(link.href).toEqual("/one/11");
|
||||
|
@ -25,5 +25,5 @@ export const ROUTER_FAKE_PROVIDERS: any[] = /*@ts2dart_const*/ [
|
||||
deps: /*@ts2dart_const*/
|
||||
[ComponentResolver, RouterUrlSerializer, RouterOutletMap, Location]
|
||||
},
|
||||
/*@ts2dart_Provider*/ {provide: RouteSegment, useFactory: (r) => r.routeTree.root, deps: [Router]}
|
||||
/*@ts2dart_Provider*/ {provide: RouteSegment, useFactory: (r: any /** TODO #9100 */) => r.routeTree.root, deps: [Router]}
|
||||
];
|
||||
|
Reference in New Issue
Block a user