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:
ScottSWu
2016-06-08 15:45:15 -07:00
parent 87d824e1b4
commit 86fbd50c3d
305 changed files with 2338 additions and 2337 deletions

View File

@ -130,7 +130,7 @@ export function main() {
]);
beforeEach(inject([TestComponentBuilder, ElementSchemaRegistry, RenderLog, DirectiveLog],
(_tcb, _elSchema, _renderLog, _directiveLog) => {
(_tcb: any /** TODO #9100 */, _elSchema: any /** TODO #9100 */, _renderLog: any /** TODO #9100 */, _directiveLog: any /** TODO #9100 */) => {
tcb = _tcb;
elSchema = _elSchema;
renderLog = _renderLog;
@ -329,7 +329,7 @@ export function main() {
it('should support function calls', fakeAsync(() => {
var ctx = _bindSimpleValue('a()(99)', TestData);
ctx.componentInstance.a = () => (a) => a;
ctx.componentInstance.a = () => (a: any /** TODO #9100 */) => a;
ctx.detectChanges(false);
expect(renderLog.log).toEqual(['someProp=99']);
}));
@ -1188,13 +1188,13 @@ class DirectiveLog {
@Pipe({name: 'countingPipe'})
class CountingPipe implements PipeTransform {
state: number = 0;
transform(value) { return `${value} state:${this.state ++}`; }
transform(value: any /** TODO #9100 */) { return `${value} state:${this.state ++}`; }
}
@Pipe({name: 'countingImpurePipe', pure: false})
class CountingImpurePipe implements PipeTransform {
state: number = 0;
transform(value) { return `${value} state:${this.state ++}`; }
transform(value: any /** TODO #9100 */) { return `${value} state:${this.state ++}`; }
}
@Pipe({name: 'pipeWithOnDestroy'})
@ -1203,22 +1203,22 @@ class PipeWithOnDestroy implements PipeTransform, OnDestroy {
ngOnDestroy() { this.directiveLog.add('pipeWithOnDestroy', 'ngOnDestroy'); }
transform(value) { return null; }
transform(value: any /** TODO #9100 */): any /** TODO #9100 */ { return null; }
}
@Pipe({name: 'identityPipe'})
class IdentityPipe implements PipeTransform {
transform(value) { return value; }
transform(value: any /** TODO #9100 */) { return value; }
}
@Pipe({name: 'wrappedPipe'})
class WrappedPipe implements PipeTransform {
transform(value) { return WrappedValue.wrap(value); }
transform(value: any /** TODO #9100 */) { return WrappedValue.wrap(value); }
}
@Pipe({name: 'multiArgPipe'})
class MultiArgPipe implements PipeTransform {
transform(value, arg1, arg2, arg3 = 'default') { return `${value} ${arg1} ${arg2} ${arg3}`; }
transform(value: any /** TODO #9100 */, arg1: any /** TODO #9100 */, arg2: any /** TODO #9100 */, arg3 = 'default') { return `${value} ${arg1} ${arg2} ${arg3}`; }
}
@Component({selector: 'test-cmp', template: '', directives: ALL_DIRECTIVES, pipes: ALL_PIPES})
@ -1271,10 +1271,10 @@ class EmitterDirective {
@Directive({selector: '[testDirective]', exportAs: 'testDirective'})
class TestDirective implements OnInit, DoCheck, OnChanges, AfterContentInit, AfterContentChecked,
AfterViewInit, AfterViewChecked, OnDestroy {
@Input() a;
@Input() b;
changes;
event;
@Input() a: any /** TODO #9100 */;
@Input() b: any /** TODO #9100 */;
changes: any /** TODO #9100 */;
event: any /** TODO #9100 */;
eventEmitter: EventEmitter<string> = new EventEmitter<string>();
@Input('testDirective') name: string;
@ -1283,7 +1283,7 @@ class TestDirective implements OnInit, DoCheck, OnChanges, AfterContentInit, Aft
constructor(public log: DirectiveLog) {}
onEvent(event) { this.event = event; }
onEvent(event: any /** TODO #9100 */) { this.event = event; }
ngDoCheck() { this.log.add(this.name, 'ngDoCheck'); }
@ -1294,10 +1294,10 @@ class TestDirective implements OnInit, DoCheck, OnChanges, AfterContentInit, Aft
}
}
ngOnChanges(changes) {
ngOnChanges(changes: any /** TODO #9100 */) {
this.log.add(this.name, 'ngOnChanges');
var r = {};
StringMapWrapper.forEach(changes, (c, key) => r[key] = c.currentValue);
StringMapWrapper.forEach(changes, (c: any /** TODO #9100 */, key: any /** TODO #9100 */) => (r as any /** TODO #9100 */)[key] = c.currentValue);
this.changes = r;
if (this.throwOn == 'ngOnChanges') {
throw new BaseException('Boom!');
@ -1401,9 +1401,9 @@ class Person {
this.address = address;
}
sayHi(m) { return `Hi, ${m}`; }
sayHi(m: any /** TODO #9100 */) { return `Hi, ${m}`; }
passThrough(val) { return val; }
passThrough(val: any /** TODO #9100 */) { return val; }
toString(): string {
var address = this.address == null ? '' : ' address=' + this.address.toString();
@ -1416,7 +1416,7 @@ class Address {
cityGetterCalls: number = 0;
zipCodeGetterCalls: number = 0;
constructor(public _city: string, public _zipcode = null) {}
constructor(public _city: string, public _zipcode: any /** TODO #9100 */ = null) {}
get city() {
this.cityGetterCalls++;

View File

@ -28,7 +28,7 @@ export function main() {
describe("loading next to a location", () => {
it('should work',
inject([DynamicComponentLoader, TestComponentBuilder, AsyncTestCompleter],
(loader: DynamicComponentLoader, tcb: TestComponentBuilder, async) => {
(loader: DynamicComponentLoader, tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.createAsync(MyComp3).then((tc) => {
tc.detectChanges();
loader.loadNextToLocation(DynamicallyLoaded,
@ -44,7 +44,7 @@ export function main() {
it('should return a disposable component ref',
inject(
[DynamicComponentLoader, TestComponentBuilder, AsyncTestCompleter],
(loader: DynamicComponentLoader, tcb: TestComponentBuilder, async) => {
(loader: DynamicComponentLoader, tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.createAsync(MyComp3).then((tc) => {
tc.detectChanges();
loader.loadNextToLocation(DynamicallyLoaded, tc.componentInstance.viewContainerRef)
@ -67,7 +67,7 @@ export function main() {
it('should update host properties',
inject([DynamicComponentLoader, TestComponentBuilder, AsyncTestCompleter],
(loader: DynamicComponentLoader, tcb: TestComponentBuilder, async) => {
(loader: DynamicComponentLoader, tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.createAsync(MyComp3).then((tc) => {
tc.detectChanges();
@ -90,7 +90,7 @@ export function main() {
it('should leave the view tree in a consistent state if hydration fails',
inject([DynamicComponentLoader, TestComponentBuilder, AsyncTestCompleter],
(loader: DynamicComponentLoader, tcb: TestComponentBuilder, async) => {
(loader: DynamicComponentLoader, tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.createAsync(MyComp3).then((tc: ComponentFixture<any>) => {
tc.detectChanges();
PromiseWrapper.catchError(
@ -107,7 +107,7 @@ export function main() {
it('should allow to pass projectable nodes',
inject([DynamicComponentLoader, TestComponentBuilder, AsyncTestCompleter],
(loader: DynamicComponentLoader, tcb: TestComponentBuilder, async) => {
(loader: DynamicComponentLoader, tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.createAsync(MyComp3).then((tc) => {
tc.detectChanges();
loader.loadNextToLocation(DynamicallyLoadedWithNgContent,
@ -124,7 +124,7 @@ export function main() {
it('should not throw if not enough projectable nodes are passed in',
inject([DynamicComponentLoader, TestComponentBuilder, AsyncTestCompleter],
(loader: DynamicComponentLoader, tcb: TestComponentBuilder, async) => {
(loader: DynamicComponentLoader, tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.createAsync(MyComp3).then((tc) => {
tc.detectChanges();
loader.loadNextToLocation(DynamicallyLoadedWithNgContent,
@ -138,7 +138,7 @@ export function main() {
describe('loadAsRoot', () => {
it('should allow to create, update and destroy components',
inject([AsyncTestCompleter, DynamicComponentLoader, DOCUMENT, Injector],
(async, loader: DynamicComponentLoader, doc, injector: Injector) => {
(async: any /** TODO #9100 */, loader: DynamicComponentLoader, doc: any /** TODO #9100 */, injector: Injector) => {
var rootEl = createRootElement(doc, 'child-cmp');
getDOM().appendChild(doc.body, rootEl);
loader.loadAsRoot(ChildComp, null, injector)
@ -167,7 +167,7 @@ export function main() {
it('should allow to pass projectable nodes',
inject([AsyncTestCompleter, DynamicComponentLoader, DOCUMENT, Injector],
(async, loader: DynamicComponentLoader, doc, injector: Injector) => {
(async: any /** TODO #9100 */, loader: DynamicComponentLoader, doc: any /** TODO #9100 */, injector: Injector) => {
var rootEl = createRootElement(doc, 'dummy');
getDOM().appendChild(doc.body, rootEl);
loader.loadAsRoot(DynamicallyLoadedWithNgContent, null, injector, null,

View File

@ -103,7 +103,7 @@ function declareTests(isJit: boolean) {
describe('react to record changes', function() {
it('should consume text node changes',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({template: '<div>{{ctxProp}}</div>'}))
.createAsync(MyComp)
.then((fixture) => {
@ -116,7 +116,7 @@ function declareTests(isJit: boolean) {
}));
it('should update text node with a blank string when interpolation evaluates to null',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({template: '<div>{{null}}{{ctxProp}}</div>'}))
.createAsync(MyComp)
.then((fixture) => {
@ -129,7 +129,7 @@ function declareTests(isJit: boolean) {
}));
it('should consume element binding changes',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({template: '<div [id]="ctxProp"></div>'}))
.createAsync(MyComp)
.then((fixture) => {
@ -143,7 +143,7 @@ function declareTests(isJit: boolean) {
}));
it('should consume binding to aria-* attributes',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp,
new ViewMetadata({template: '<div [attr.aria-label]="ctxProp"></div>'}))
@ -166,7 +166,7 @@ function declareTests(isJit: boolean) {
}));
it('should remove an attribute when attribute expression evaluates to null',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp,
new ViewMetadata({template: '<div [attr.foo]="ctxProp"></div>'}))
@ -190,7 +190,7 @@ function declareTests(isJit: boolean) {
}));
it('should remove style when when style expression evaluates to null',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp,
new ViewMetadata({template: '<div [style.height.px]="ctxProp"></div>'}))
@ -212,7 +212,7 @@ function declareTests(isJit: boolean) {
}));
it('should consume binding to property names where attr name and property name do not match',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp,
new ViewMetadata({template: '<div [tabindex]="ctxNumProp"></div>'}))
@ -231,7 +231,7 @@ function declareTests(isJit: boolean) {
}));
it('should consume binding to camel-cased properties',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp,
new ViewMetadata({template: '<input [readOnly]="ctxBoolProp">'}))
@ -250,7 +250,7 @@ function declareTests(isJit: boolean) {
}));
it('should consume binding to innerHtml',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp,
new ViewMetadata({template: '<div innerHtml="{{ctxProp}}"></div>'}))
@ -272,7 +272,7 @@ function declareTests(isJit: boolean) {
}));
it('should consume binding to className using class alias',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
MyComp,
new ViewMetadata({template: '<div class="initial" [class]="ctxProp"></div>'}))
@ -292,7 +292,7 @@ function declareTests(isJit: boolean) {
}));
it('should consume directive watch expression change.',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var tpl = '<span>' +
'<div my-dir [elprop]="ctxProp"></div>' +
'<div my-dir elprop="Hi there!"></div>' +
@ -320,7 +320,7 @@ function declareTests(isJit: boolean) {
describe('pipes', () => {
it("should support pipes in bindings",
inject(
[TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
[TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
MyComp, new ViewMetadata({
template: '<div my-dir #dir="mydir" [elprop]="ctxProp | double"></div>',
@ -341,7 +341,7 @@ function declareTests(isJit: boolean) {
});
it('should support nested components.',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
MyComp,
new ViewMetadata({template: '<child-cmp></child-cmp>', directives: [ChildComp]}))
@ -358,7 +358,7 @@ function declareTests(isJit: boolean) {
// GH issue 328 - https://github.com/angular/angular/issues/328
it('should support different directive types on a single node',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: '<child-cmp my-dir [elprop]="ctxProp"></child-cmp>',
directives: [MyDir, ChildComp]
@ -380,7 +380,7 @@ function declareTests(isJit: boolean) {
}));
it('should support directives where a binding attribute is not given',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
// No attribute "el-prop" specified.
template: '<p my-dir></p>',
@ -392,7 +392,7 @@ function declareTests(isJit: boolean) {
}));
it('should execute a given directive once, even if specified multiple times',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
MyComp, new ViewMetadata({
template: '<p no-duplicate></p>',
@ -406,7 +406,7 @@ function declareTests(isJit: boolean) {
}));
it('should support directives where a selector matches property binding',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata(
{template: '<p [id]="ctxProp"></p>', directives: [IdDir]}))
@ -428,7 +428,7 @@ function declareTests(isJit: boolean) {
}));
it('should support directives where a selector matches event binding',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
MyComp,
new ViewMetadata(
@ -443,7 +443,7 @@ function declareTests(isJit: boolean) {
}));
it('should read directives metadata from their binding token',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: '<div public-api><div needs-public-api></div></div>',
directives: [PrivateImpl, NeedsPublicApi]
@ -454,7 +454,7 @@ function declareTests(isJit: boolean) {
}));
it('should support template directives via `<template>` elements.',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
MyComp, new ViewMetadata({
template:
@ -477,7 +477,7 @@ function declareTests(isJit: boolean) {
}));
it('should not detach views in ViewContainers when the parent view is destroyed.',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
MyComp, new ViewMetadata({
template:
@ -506,7 +506,7 @@ function declareTests(isJit: boolean) {
}));
it('should use a comment while stamping out `<template>` elements.',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({template: '<template></template>'}))
.createAsync(MyComp)
@ -519,7 +519,7 @@ function declareTests(isJit: boolean) {
}));
it('should support template directives via `template` attribute.',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
MyComp, new ViewMetadata({
template:
@ -541,7 +541,7 @@ function declareTests(isJit: boolean) {
}));
it('should allow to transplant TemplateRefs into other ViewContainers',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
MyComp, new ViewMetadata({
template:
@ -564,7 +564,7 @@ function declareTests(isJit: boolean) {
describe("reference bindings", () => {
it('should assign a component to a ref-',
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: '<p><child-cmp ref-alice></child-cmp></p>',
directives: [ChildComp]
@ -580,7 +580,7 @@ function declareTests(isJit: boolean) {
it('should assign a directive to a ref-',
inject(
[TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
[TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: '<div><div export-dir #localdir="dir"></div></div>',
directives: [ExportDir]
@ -598,7 +598,7 @@ function declareTests(isJit: boolean) {
it('should make the assigned component accessible in property bindings, even if they were declared before the component',
inject(
[TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
MyComp, new ViewMetadata({
template:
@ -617,7 +617,7 @@ function declareTests(isJit: boolean) {
it('should assign two component instances each with a ref-',
inject(
[TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
MyComp, new ViewMetadata({
template:
@ -641,7 +641,7 @@ function declareTests(isJit: boolean) {
it('should assign the component instance to a ref- with shorthand syntax',
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder,
async) => {tcb.overrideView(MyComp, new ViewMetadata({
async: any /** TODO #9100 */) => {tcb.overrideView(MyComp, new ViewMetadata({
template: '<child-cmp #alice></child-cmp>',
directives: [ChildComp]
}))
@ -657,7 +657,7 @@ function declareTests(isJit: boolean) {
it('should assign the element instance to a user-defined variable',
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: '<div><div ref-alice><i>Hello</i></div></div>'
}))
@ -675,7 +675,7 @@ function declareTests(isJit: boolean) {
it('should assign the TemplateRef to a user-defined variable',
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata(
{template: '<template ref-alice></template>'}))
@ -690,7 +690,7 @@ function declareTests(isJit: boolean) {
it('should preserve case',
inject(
[TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
[TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: '<p><child-cmp ref-superAlice></child-cmp></p>',
directives: [ChildComp]
@ -709,7 +709,7 @@ function declareTests(isJit: boolean) {
describe('variables', () => {
it('should allow to use variables in a for loop',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder,
async) => {
async: any /** TODO #9100 */) => {
tcb.overrideView(
MyComp, new ViewMetadata({
template:
@ -733,7 +733,7 @@ function declareTests(isJit: boolean) {
it("should use ChangeDetectorRef to manually request a check",
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: '<push-cmp-with-ref #cmp></push-cmp-with-ref>',
@ -760,7 +760,7 @@ function declareTests(isJit: boolean) {
it("should be checked when its bindings got updated",
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: '<push-cmp [prop]="ctxProp" #cmp></push-cmp>',
@ -798,7 +798,7 @@ function declareTests(isJit: boolean) {
var cmpEl = fixture.debugElement.children[0];
var cmp: PushCmpWithHostEvent = cmpEl.inject(PushCmpWithHostEvent);
cmp.ctxCallback = (_) => fixture.destroy();
cmp.ctxCallback = (_: any /** TODO #9100 */) => fixture.destroy();
expect(() => cmpEl.triggerEventHandler('click', <Event>{})).not.toThrow();
})));
@ -806,7 +806,7 @@ function declareTests(isJit: boolean) {
it("should be checked when an event is fired",
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: '<push-cmp [prop]="ctxProp" #cmp></push-cmp>',
@ -847,7 +847,7 @@ function declareTests(isJit: boolean) {
it('should not affect updating properties on the component',
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
MyComp, new ViewMetadata({
template:
@ -903,7 +903,7 @@ function declareTests(isJit: boolean) {
it('should create a component that injects an @Host',
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder,
async) => {tcb.overrideView(MyComp, new ViewMetadata({
async: any /** TODO #9100 */) => {tcb.overrideView(MyComp, new ViewMetadata({
template: `
<some-directive>
<p>
@ -926,7 +926,7 @@ function declareTests(isJit: boolean) {
})}));
it('should create a component that injects an @Host through viewcontainer directive',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: `
<some-directive>
@ -951,7 +951,7 @@ function declareTests(isJit: boolean) {
}));
it('should support events via EventEmitter on regular elements',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: '<div emitter listener></div>',
directives: [DirectiveEmittingEvent, DirectiveListeningEvent]
@ -985,7 +985,7 @@ function declareTests(isJit: boolean) {
}));
it('should support events via EventEmitter on template elements',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
MyComp, new ViewMetadata({
template: '<template emitter listener (event)="ctxProp=$event"></template>',
@ -1015,7 +1015,7 @@ function declareTests(isJit: boolean) {
}));
it('should support [()] syntax',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: '<div [(control)]="ctxProp" two-way></div>',
directives: [DirectiveWithTwoWayBinding]
@ -1041,7 +1041,7 @@ function declareTests(isJit: boolean) {
}));
it('should support render events',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
MyComp,
new ViewMetadata(
@ -1069,7 +1069,7 @@ function declareTests(isJit: boolean) {
}));
it('should support render global events',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
MyComp,
new ViewMetadata(
@ -1096,7 +1096,7 @@ function declareTests(isJit: boolean) {
}));
it('should support updating host element via hostAttributes',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: '<div update-host-attributes></div>',
directives: [DirectiveUpdatingHostAttributes]
@ -1115,7 +1115,7 @@ function declareTests(isJit: boolean) {
}));
it('should support updating host element via hostProperties',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: '<div update-host-properties></div>',
directives: [DirectiveUpdatingHostProperties]
@ -1140,7 +1140,7 @@ function declareTests(isJit: boolean) {
if (getDOM().supportsDOMEvents()) {
it('should support preventing default on render events',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder,
async) => {
async: any /** TODO #9100 */) => {
tcb.overrideView(
MyComp, new ViewMetadata({
template:
@ -1171,7 +1171,7 @@ function declareTests(isJit: boolean) {
}
it('should support render global events from multiple directives',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
MyComp, new ViewMetadata({
template: '<div *ngIf="ctxBoolProp" listener listenerother></div>',
@ -1215,7 +1215,7 @@ function declareTests(isJit: boolean) {
describe('dynamic ViewContainers', () => {
it('should allow to create a ViewContainerRef at any bound location',
inject([TestComponentBuilder, AsyncTestCompleter, ComponentResolver],
(tcb: TestComponentBuilder, async, compiler) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */, compiler: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: '<div><dynamic-vp #dynamic></dynamic-vp></div>',
directives: [DynamicViewport]
@ -1237,7 +1237,7 @@ function declareTests(isJit: boolean) {
});
it('should support static attributes',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
MyComp,
new ViewMetadata(
@ -1257,7 +1257,7 @@ function declareTests(isJit: boolean) {
describe("dependency injection", () => {
it("should support bindings",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
MyComp, new ViewMetadata({
template: `
@ -1278,7 +1278,7 @@ function declareTests(isJit: boolean) {
}));
it("should support viewProviders",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(DirectiveProvidingInjectableInView, new ViewMetadata({
template: `
<directive-consuming-injectable #consuming>
@ -1296,7 +1296,7 @@ function declareTests(isJit: boolean) {
}));
it("should support unbounded lookup",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: `
<directive-providing-injectable>
@ -1326,7 +1326,7 @@ function declareTests(isJit: boolean) {
}));
it("should support the event-bus scenario",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: `
<grand-parent-providing-event-bus>
@ -1362,7 +1362,7 @@ function declareTests(isJit: boolean) {
}));
it("should instantiate bindings lazily",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
MyComp, new ViewMetadata({
template: `
@ -1391,7 +1391,7 @@ function declareTests(isJit: boolean) {
describe("corner cases", () => {
it('should remove script tags from templates',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: `
<script>alert("Ooops");</script>
@ -1409,7 +1409,7 @@ function declareTests(isJit: boolean) {
describe("error handling", () => {
it('should report a meaningful error when a directive is missing annotation',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb = tcb.overrideView(
MyComp,
new ViewMetadata({template: '', directives: [SomeDirectiveMissingAnnotation]}));
@ -1423,7 +1423,7 @@ function declareTests(isJit: boolean) {
}));
it('should report a meaningful error when a component is missing view annotation',
inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
inject([TestComponentBuilder], (tcb: TestComponentBuilder): any /** TODO #9100 */ => {
try {
tcb.createAsync(ComponentWithoutView);
} catch (e) {
@ -1433,7 +1433,7 @@ function declareTests(isJit: boolean) {
}));
it('should report a meaningful error when a directive is null',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb = tcb.overrideView(MyComp, new ViewMetadata({directives: [[null]], template: ''}));
@ -1446,7 +1446,7 @@ function declareTests(isJit: boolean) {
}));
it('should provide an error context when an error happens in DI',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb =
tcb.overrideView(MyComp, new ViewMetadata({
@ -1464,7 +1464,7 @@ function declareTests(isJit: boolean) {
}));
it('should provide an error context when an error happens in change detection',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb = tcb.overrideView(
MyComp, new ViewMetadata({template: `<input [value]="one.two.three" #local>`}));
@ -1488,7 +1488,7 @@ function declareTests(isJit: boolean) {
}));
it('should provide an error context when an error happens in change detection (text node)',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb = tcb.overrideView(MyComp,
new ViewMetadata({template: `<div>{{one.two.three}}</div>`}));
@ -1540,9 +1540,9 @@ function declareTests(isJit: boolean) {
if (!IS_DART) {
it('should report a meaningful error when a directive is undefined',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder,
async) => {
async: any /** TODO #9100 */) => {
var undefinedValue;
var undefinedValue: any /** TODO #9100 */;
tcb = tcb.overrideView(MyComp,
new ViewMetadata({directives: [undefinedValue], template: ''}));
@ -1558,7 +1558,7 @@ function declareTests(isJit: boolean) {
it('should specify a location of an error that happened during change detection (text)',
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({template: '<div>{{a.b}}</div>'}))
@ -1572,7 +1572,7 @@ function declareTests(isJit: boolean) {
it('should specify a location of an error that happened during change detection (element property)',
inject(
[TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({template: '<div [title]="a.b"></div>'}))
@ -1584,7 +1584,7 @@ function declareTests(isJit: boolean) {
it('should specify a location of an error that happened during change detection (directive property)',
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: '<child-cmp [title]="a.b"></child-cmp>',
@ -1600,7 +1600,7 @@ function declareTests(isJit: boolean) {
});
it('should support imperative views',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: '<simple-imp-cmp></simple-imp-cmp>',
directives: [SimpleImperativeViewComponent]
@ -1614,7 +1614,7 @@ function declareTests(isJit: boolean) {
it('should support moving embedded views around',
inject([TestComponentBuilder, AsyncTestCompleter, ANCHOR_ELEMENT],
(tcb: TestComponentBuilder, async, anchorElement) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */, anchorElement: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: '<div><div *someImpvp="ctxBoolProp">hello</div></div>',
directives: [SomeImperativeViewport]
@ -1641,7 +1641,7 @@ function declareTests(isJit: boolean) {
if (!IS_DART) {
it('should throw on bindings to unknown properties',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder,
async) => {
async: any /** TODO #9100 */) => {
tcb =
tcb.overrideView(MyComp,
new ViewMetadata({template: '<div unknown="{{ctxProp}}"></div>'}))
@ -1656,7 +1656,7 @@ function declareTests(isJit: boolean) {
it('should not throw for property binding to a non-existing property when there is a matching directive property',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder,
async) => {
async: any /** TODO #9100 */) => {
tcb.overrideView(
MyComp,
new ViewMetadata(
@ -1667,7 +1667,7 @@ function declareTests(isJit: boolean) {
}
it('should not be created when there is a directive with the same property',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: '<span [title]="ctxProp"></span>',
directives: [DirectiveWithTitle]
@ -1686,7 +1686,7 @@ function declareTests(isJit: boolean) {
}));
it('should work when a directive uses hostProperty to update the DOM element',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: '<span [title]="ctxProp"></span>',
directives: [DirectiveWithTitleAndHostProperty]
@ -1710,7 +1710,7 @@ function declareTests(isJit: boolean) {
() => [{provide: CompilerConfig, useValue: new CompilerConfig(true, true, isJit)}]);
it('should reflect property values as attributes',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var tpl = '<div>' +
'<div my-dir [elprop]="ctxProp"></div>' +
'</div>';
@ -1728,7 +1728,7 @@ function declareTests(isJit: boolean) {
}));
it('should reflect property values on template comments',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var tpl = '<template [ngIf]="ctxBoolProp"></template>';
tcb.overrideView(MyComp, new ViewMetadata({template: tpl, directives: [NgIf]}))
@ -1746,7 +1746,7 @@ function declareTests(isJit: boolean) {
describe('property decorators', () => {
it('should support property decorators',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
MyComp, new ViewMetadata({
template: '<with-prop-decorators elProp="aaa"></with-prop-decorators>',
@ -1762,7 +1762,7 @@ function declareTests(isJit: boolean) {
}));
it('should support host binding decorators',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: '<with-prop-decorators></with-prop-decorators>',
directives: [DirectiveWithPropDecorators]
@ -1803,7 +1803,7 @@ function declareTests(isJit: boolean) {
it('should support host listener decorators',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder,
async) => {
async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: '<with-prop-decorators></with-prop-decorators>',
directives: [DirectiveWithPropDecorators]
@ -1822,7 +1822,7 @@ function declareTests(isJit: boolean) {
}
it('should support defining views in the component decorator',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp, new ViewMetadata({
template: '<component-with-template></component-with-template>',
directives: [ComponentWithTemplate]
@ -1842,7 +1842,7 @@ function declareTests(isJit: boolean) {
describe('svg', () => {
it('should support svg elements',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder,
async) => {
async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp,
new ViewMetadata({template: '<svg><use xlink:href="Port" /></svg>'}))
.createAsync(MyComp)
@ -1874,7 +1874,7 @@ function declareTests(isJit: boolean) {
it('should support attributes with namespace',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder,
async) => {
async: any /** TODO #9100 */) => {
tcb.overrideView(SomeCmp, new ViewMetadata({template: '<svg:use xlink:href="#id" />'}))
.createAsync(SomeCmp)
.then((fixture) => {
@ -1887,7 +1887,7 @@ function declareTests(isJit: boolean) {
it('should support binding to attributes with namespace',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder,
async) => {
async: any /** TODO #9100 */) => {
tcb.overrideView(SomeCmp,
new ViewMetadata({template: '<svg:use [attr.xlink:href]="value" />'}))
.createAsync(SomeCmp)
@ -1924,7 +1924,7 @@ class MyService {
@Component({selector: 'simple-imp-cmp', template: ''})
@Injectable()
class SimpleImperativeViewComponent {
done;
done: any /** TODO #9100 */;
constructor(self: ElementRef, renderer: Renderer) {
var hostElement = self.nativeElement;
@ -1980,7 +1980,7 @@ class EventCmp {
@Injectable()
class PushCmp {
numberOfChecks: number;
prop;
prop: any /** TODO #9100 */;
constructor() { this.numberOfChecks = 0; }
@ -2002,7 +2002,7 @@ class PushCmp {
class PushCmpWithRef {
numberOfChecks: number;
ref: ChangeDetectorRef;
prop;
prop: any /** TODO #9100 */;
constructor(ref: ChangeDetectorRef) {
this.numberOfChecks = 0;
@ -2024,7 +2024,7 @@ class PushCmpWithRef {
template: ''
})
class PushCmpWithHostEvent {
ctxCallback: Function = (_) => {};
ctxCallback: Function = (_: any /** TODO #9100 */) => {};
}
@Component({
@ -2049,7 +2049,7 @@ class PushCmpWithAsyncPipe {
return this.promise;
}
resolve(value) { this.completer.resolve(value); }
resolve(value: any /** TODO #9100 */) { this.completer.resolve(value); }
}
@Component({selector: 'my-comp', directives: []})
@ -2142,7 +2142,7 @@ class SomeViewport {
@Pipe({name: 'double'})
class DoublePipe implements PipeTransform, OnDestroy {
ngOnDestroy() {}
transform(value) { return `${value}${value}`; }
transform(value: any /** TODO #9100 */) { return `${value}${value}`; }
}
@Directive({selector: '[emitter]', outputs: ['event']})
@ -2215,13 +2215,13 @@ class DirectiveListeningDomEventOther {
@Directive({selector: '[listenerprevent]', host: {'(click)': 'onEvent($event)'}})
@Injectable()
class DirectiveListeningDomEventPrevent {
onEvent(event) { return false; }
onEvent(event: any /** TODO #9100 */) { return false; }
}
@Directive({selector: '[listenernoprevent]', host: {'(click)': 'onEvent($event)'}})
@Injectable()
class DirectiveListeningDomEventNoPrevent {
onEvent(event) { return true; }
onEvent(event: any /** TODO #9100 */) { return true; }
}
@Directive({selector: '[id]', inputs: ['id']})
@ -2240,9 +2240,9 @@ class EventDir {
@Directive({selector: '[static]'})
@Injectable()
class NeedsAttribute {
typeAttribute;
staticAttribute;
fooAttribute;
typeAttribute: any /** TODO #9100 */;
staticAttribute: any /** TODO #9100 */;
fooAttribute: any /** TODO #9100 */;
constructor(@Attribute('type') typeAttribute: String,
@Attribute('static') staticAttribute: String,
@Attribute('foo') fooAttribute: String) {
@ -2314,9 +2314,9 @@ class ToolbarComponent {
@Injectable()
class DirectiveWithTwoWayBinding {
controlChange = new EventEmitter();
control = null;
control: any /** TODO #9100 */ = null;
triggerChange(value) { ObservableWrapper.callEmit(this.controlChange, value); }
triggerChange(value: any /** TODO #9100 */) { ObservableWrapper.callEmit(this.controlChange, value); }
}
@Injectable()
@ -2373,9 +2373,9 @@ class DirectiveProvidingInjectableInHostAndView {
@Component({selector: 'directive-consuming-injectable', template: ''})
@Injectable()
class DirectiveConsumingInjectable {
injectable;
injectable: any /** TODO #9100 */;
constructor(@Host() @Inject(InjectableService) injectable) { this.injectable = injectable; }
constructor(@Host() @Inject(InjectableService) injectable: any /** TODO #9100 */) { this.injectable = injectable; }
}
@ -2383,13 +2383,13 @@ class DirectiveConsumingInjectable {
@Component({selector: 'directive-containing-directive-consuming-an-injectable'})
@Injectable()
class DirectiveContainingDirectiveConsumingAnInjectable {
directive;
directive: any /** TODO #9100 */;
}
@Component({selector: 'directive-consuming-injectable-unbounded', template: ''})
@Injectable()
class DirectiveConsumingInjectableUnbounded {
injectable;
injectable: any /** TODO #9100 */;
constructor(injectable: InjectableService,
@SkipSelf() parent: DirectiveContainingDirectiveConsumingAnInjectable) {
@ -2422,7 +2422,7 @@ class GrandParentProvidingEventBus {
constructor(bus: EventBus) { this.bus = bus; }
}
function createParentBus(peb) {
function createParentBus(peb: any /** TODO #9100 */) {
return new EventBus(peb, "parent");
}
@ -2455,9 +2455,9 @@ class ChildConsumingEventBus {
@Injectable()
class SomeImperativeViewport {
view: EmbeddedViewRef<Object>;
anchor;
anchor: any /** TODO #9100 */;
constructor(public vc: ViewContainerRef, public templateRef: TemplateRef<Object>,
@Inject(ANCHOR_ELEMENT) anchor) {
@Inject(ANCHOR_ELEMENT) anchor: any /** TODO #9100 */) {
this.view = null;
this.anchor = anchor;
}
@ -2516,18 +2516,18 @@ class ComponentWithTemplate {
@Directive({selector: 'with-prop-decorators'})
class DirectiveWithPropDecorators {
target;
target: any /** TODO #9100 */;
@Input('elProp') dirProp: string;
@Output('elEvent') event = new EventEmitter();
@HostBinding("attr.my-attr") myAttr: string;
@HostListener("click", ["$event.target"])
onClick(target) {
onClick(target: any /** TODO #9100 */) {
this.target = target;
}
fireEvent(msg) { ObservableWrapper.callEmit(this.event, msg); }
fireEvent(msg: any /** TODO #9100 */) { ObservableWrapper.callEmit(this.event, msg); }
}
@Component({selector: 'some-cmp'})

View File

@ -35,7 +35,7 @@ import {getAllDebugNodes} from '@angular/core/src/debug/debug_node';
export function main() {
describe('projection', () => {
it('should support simple components',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MainComp, new ViewMetadata({
template: '<simple>' +
'<div>A</div>' +
@ -50,7 +50,7 @@ export function main() {
}));
it('should support simple components with text interpolation as direct children',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MainComp, new ViewMetadata({
template: '{{\'START(\'}}<simple>' +
'{{text}}' +
@ -68,7 +68,7 @@ export function main() {
}));
it('should support projecting text interpolation to a non bound element',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
Simple,
new ViewMetadata(
@ -88,7 +88,7 @@ export function main() {
it('should support projecting text interpolation to a non bound element with other bound elements after it',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
Simple, new ViewMetadata({
template:
@ -109,7 +109,7 @@ export function main() {
}));
it('should project content components',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
Simple,
new ViewMetadata(
@ -129,7 +129,7 @@ export function main() {
}));
it('should not show the light dom even if there is no content tag',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MainComp,
new ViewMetadata({template: '<empty>A</empty>', directives: [Empty]}))
.createAsync(MainComp)
@ -141,7 +141,7 @@ export function main() {
}));
it('should support multiple content tags',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MainComp, new ViewMetadata({
template: '<multiple-content-tags>' +
'<div>B</div>' +
@ -159,7 +159,7 @@ export function main() {
}));
it('should redistribute only direct children',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MainComp, new ViewMetadata({
template: '<multiple-content-tags>' +
'<div>B<div class="left">A</div></div>' +
@ -176,7 +176,7 @@ export function main() {
}));
it("should redistribute direct child viewcontainers when the light dom changes",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MainComp, new ViewMetadata({
template: '<multiple-content-tags>' +
'<template manual class="left"><div>A1</div></template>' +
@ -204,7 +204,7 @@ export function main() {
}));
it("should support nested components",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MainComp, new ViewMetadata({
template: '<outer-with-indirect-nested>' +
'<div>A</div>' +
@ -221,7 +221,7 @@ export function main() {
}));
it("should support nesting with content being direct child of a nested component",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MainComp, new ViewMetadata({
template: '<outer>' +
'<template manual class="left"><div>A</div></template>' +
@ -246,7 +246,7 @@ export function main() {
}));
it('should redistribute when the shadow dom changes',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MainComp, new ViewMetadata({
template: '<conditional-content>' +
'<div class="left">A</div>' +
@ -278,7 +278,7 @@ export function main() {
// important as we are removing the ng-content element during compilation,
// which could skrew up text node indices.
it('should support text nodes after content tags',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
MainComp,
@ -299,7 +299,7 @@ export function main() {
// important as we are moving style tags around during compilation,
// which could skrew up text node indices.
it('should support text nodes after style tags',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
MainComp,
@ -316,7 +316,7 @@ export function main() {
}));
it('should support moving non projected light dom around',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MainComp, new ViewMetadata({
template: '<empty>' +
' <template manual><div>A</div></template>' +
@ -326,7 +326,7 @@ export function main() {
}))
.createAsync(MainComp)
.then((main) => {
var sourceDirective;
var sourceDirective: any /** TODO #9100 */;
// We can't use the child nodes to get a hold of this because it's not in the dom at
// all.
@ -349,7 +349,7 @@ export function main() {
}));
it('should support moving projected light dom around',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MainComp, new ViewMetadata({
template: '<simple><template manual><div>A</div></template></simple>' +
'START(<div project></div>)END',
@ -373,7 +373,7 @@ export function main() {
}));
it('should support moving ng-content around',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
MainComp, new ViewMetadata({
template: '<conditional-content>' +
@ -411,7 +411,7 @@ export function main() {
// is still important as we are merging proto views independent of
// the presence of ng-content elements!
it('should still allow to implement a recursive trees',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MainComp,
new ViewMetadata({template: '<tree></tree>', directives: [Tree]}))
.createAsync(MainComp)
@ -433,7 +433,7 @@ export function main() {
// is still important as we are merging proto views independent of
// the presence of ng-content elements!
it('should still allow to implement a recursive trees via multiple components',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MainComp,
new ViewMetadata({template: '<tree></tree>', directives: [Tree]}))
.overrideView(Tree, new ViewMetadata({
@ -468,7 +468,7 @@ export function main() {
if (getDOM().supportsNativeShadowDOM()) {
it('should support native content projection and isolate styles per component',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MainComp, new ViewMetadata({
template: '<simple-native1><div>A</div></simple-native1>' +
'<simple-native2><div>B</div></simple-native2>',
@ -487,7 +487,7 @@ export function main() {
if (getDOM().supportsDOMEvents()) {
it('should support non emulated styles',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MainComp, new ViewMetadata({
template: '<div class="redStyle"></div>',
styles: ['.redStyle { color: red}'],
@ -508,7 +508,7 @@ export function main() {
}));
it('should support emulated style encapsulation',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MainComp, new ViewMetadata({
template: '<div></div>',
styles: ['div { color: red}'],
@ -528,7 +528,7 @@ export function main() {
}
it('should support nested conditionals that contain ng-contents',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MainComp, new ViewMetadata({
template: `<conditional-text>a</conditional-text>`,
directives: [ConditionalTextComponent]
@ -552,7 +552,7 @@ export function main() {
}));
it('should allow to switch the order of nested components via ng-content',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MainComp, new ViewMetadata({
template: `<cmp-a><cmp-b></cmp-b></cmp-a>`,
directives: [CmpA, CmpB],
@ -568,7 +568,7 @@ export function main() {
}));
it('should create nested components in the right order',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MainComp, new ViewMetadata({
template: `<cmp-a1></cmp-a1><cmp-a2></cmp-a2>`,
directives: [CmpA1, CmpA2],
@ -584,7 +584,7 @@ export function main() {
}));
it('should project filled view containers into a view container',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MainComp, new ViewMetadata({
template: '<conditional-content>' +
'<div class="left">A</div>' +

View File

@ -39,7 +39,7 @@ export function main() {
describe('Query API', () => {
describe("querying by directive type", () => {
it('should contain all direct child directives in the light dom (constructor)',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div text="1"></div>' +
'<needs-query text="2"><div text="3">' +
'<div text="too-deep"></div>' +
@ -58,7 +58,7 @@ export function main() {
}));
it('should contain all direct child directives in the content dom',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
'<needs-content-children #q><div text="foo"></div></needs-content-children>';
@ -79,7 +79,7 @@ export function main() {
}));
it('should contain the first content child',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
'<needs-content-child #q><div *ngIf="shouldShow" text="foo"></div></needs-content-child>';
@ -109,7 +109,7 @@ export function main() {
}));
it('should contain the first view child',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<needs-view-child #q></needs-view-child>';
tcb.overrideTemplate(MyComp0, template)
@ -136,7 +136,7 @@ export function main() {
}));
it('should set static view and content children already after the constructor call',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
'<needs-static-content-view-child #q><div text="contentFoo"></div></needs-static-content-view-child>';
@ -158,7 +158,7 @@ export function main() {
}));
it('should contain the first view child accross embedded views',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<needs-view-child #q></needs-view-child>';
tcb.overrideTemplate(MyComp0, template)
.overrideTemplate(
@ -190,7 +190,7 @@ export function main() {
}));
it('should contain all directives in the light dom when descendants flag is used',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div text="1"></div>' +
'<needs-query-desc text="2"><div text="3">' +
'<div text="4"></div>' +
@ -208,7 +208,7 @@ export function main() {
}));
it('should contain all directives in the light dom',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<div text="1"></div>' +
'<needs-query text="2"><div text="3"></div></needs-query>' +
'<div text="4"></div>';
@ -224,7 +224,7 @@ export function main() {
}));
it('should reflect dynamically inserted directives',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
'<div text="1"></div>' +
'<needs-query text="2"><div *ngIf="shouldShow" [text]="\'3\'"></div></needs-query>' +
@ -246,7 +246,7 @@ export function main() {
}));
it('should be cleanly destroyed when a query crosses view boundaries',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
'<div text="1"></div>' +
'<needs-query text="2"><div *ngIf="shouldShow" [text]="\'3\'"></div></needs-query>' +
@ -264,7 +264,7 @@ export function main() {
}));
it('should reflect moved directives',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
'<div text="1"></div>' +
'<needs-query text="2"><div *ngFor="let i of list" [text]="i"></div></needs-query>' +
@ -286,7 +286,7 @@ export function main() {
}));
it('should throw with descriptive error when query selectors are not present',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideTemplate(MyCompBroken0, '<has-null-query-condition></has-null-query-condition>')
.createAsync(MyCompBroken0)
.catch((e) => {
@ -299,7 +299,7 @@ export function main() {
describe('query for TemplateRef', () => {
it('should find TemplateRefs in the light and shadow dom',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<needs-tpl><template><div>light</div></template></needs-tpl>';
tcb.overrideTemplate(MyComp0, template)
.createAsync(MyComp0)
@ -317,7 +317,7 @@ export function main() {
}));
it('should find named TemplateRefs',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
'<needs-named-tpl><template #tpl><div>light</div></template></needs-named-tpl>';
tcb.overrideTemplate(MyComp0, template)
@ -337,7 +337,7 @@ export function main() {
describe('read a different token', () => {
it('should contain all content children',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
'<needs-content-children-read #q text="ca"><div #q text="cb"></div></needs-content-children-read>';
@ -356,7 +356,7 @@ export function main() {
}));
it('should contain the first content child',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
'<needs-content-child-read><div #q text="ca"></div></needs-content-child-read>';
@ -374,7 +374,7 @@ export function main() {
}));
it('should contain the first view child',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<needs-view-child-read></needs-view-child-read>';
tcb.overrideTemplate(MyComp0, template)
@ -391,7 +391,7 @@ export function main() {
}));
it('should contain all child directives in the view',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<needs-view-children-read></needs-view-children-read>';
tcb.overrideTemplate(MyComp0, template)
@ -409,7 +409,7 @@ export function main() {
}));
it('should support reading a ViewContainer',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
'<needs-viewcontainer-read><template>hello</template></needs-viewcontainer-read>';
@ -430,7 +430,7 @@ export function main() {
describe("changes", () => {
it('should notify query on change',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<needs-query #q>' +
'<div text="1"></div>' +
'<div *ngIf="shouldShow" text="2"></div>' +
@ -454,7 +454,7 @@ export function main() {
}));
it("should notify child's query before notifying parent's query",
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<needs-query-desc #q1>' +
'<needs-query-desc #q2>' +
'<div text="1"></div>' +
@ -480,7 +480,7 @@ export function main() {
}));
it('should correctly clean-up when destroyed together with the directives it is querying',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<needs-query #q *ngIf="shouldShow"><div text="foo"></div></needs-query>';
tcb.overrideTemplate(MyComp0, template)
@ -510,7 +510,7 @@ export function main() {
describe("querying by var binding", () => {
it('should contain all the child directives in the light dom with the given var binding',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
'<needs-query-by-ref-binding #q>' +
'<div *ngFor="let item of list" [text]="item" #textLabel="textDir"></div>' +
@ -533,7 +533,7 @@ export function main() {
}));
it('should support querying by multiple var bindings',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<needs-query-by-ref-bindings #q>' +
'<div text="one" #textLabel1="textDir"></div>' +
'<div text="two" #textLabel2="textDir"></div>' +
@ -553,7 +553,7 @@ export function main() {
}));
it('should support dynamically inserted directives',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template =
'<needs-query-by-ref-binding #q>' +
'<div *ngFor="let item of list" [text]="item" #textLabel="textDir"></div>' +
@ -579,7 +579,7 @@ export function main() {
}));
it('should contain all the elements in the light dom with the given var binding',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<needs-query-by-ref-binding #q>' +
'<div template="ngFor: let item of list">' +
'<div #textLabel>{{item}}</div>' +
@ -603,7 +603,7 @@ export function main() {
}));
it('should contain all the elements in the light dom even if they get projected',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<needs-query-and-project #q>' +
'<div text="hello"></div><div text="world"></div>' +
'</needs-query-and-project>';
@ -620,7 +620,7 @@ export function main() {
}));
it('should support querying the view by using a view query',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<needs-view-query-by-ref-binding #q></needs-view-query-by-ref-binding>';
tcb.overrideTemplate(MyComp0, template)
@ -636,7 +636,7 @@ export function main() {
}));
it('should contain all child directives in the view dom',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<needs-view-children #q></needs-view-children>';
tcb.overrideTemplate(MyComp0, template)
@ -659,7 +659,7 @@ export function main() {
describe("querying in the view", () => {
it('should contain all the elements in the view with that have the given directive',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<needs-view-query #q><div text="ignoreme"></div></needs-view-query>';
tcb.overrideTemplate(MyComp0, template)
@ -676,7 +676,7 @@ export function main() {
}));
it('should not include directive present on the host element',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<needs-view-query #q text="self"></needs-view-query>';
tcb.overrideTemplate(MyComp0, template)
@ -693,7 +693,7 @@ export function main() {
}));
it('should reflect changes in the component',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<needs-view-query-if #q></needs-view-query-if>';
tcb.overrideTemplate(MyComp0, template)
@ -716,7 +716,7 @@ export function main() {
}));
it('should not be affected by other changes in the component',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<needs-view-query-nested-if #q></needs-view-query-nested-if>';
tcb.overrideTemplate(MyComp0, template)
@ -741,7 +741,7 @@ export function main() {
it('should maintain directives in pre-order depth-first DOM order after dynamic insertion',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<needs-view-query-order #q></needs-view-query-order>';
tcb.overrideTemplate(MyComp0, template)
@ -764,7 +764,7 @@ export function main() {
}));
it('should maintain directives in pre-order depth-first DOM order after dynamic insertion',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<needs-view-query-order-with-p #q></needs-view-query-order-with-p>';
tcb.overrideTemplate(MyComp0, template)
@ -788,7 +788,7 @@ export function main() {
}));
it('should handle long ngFor cycles',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<needs-view-query-order #q></needs-view-query-order>';
tcb.overrideTemplate(MyComp0, template)
@ -810,7 +810,7 @@ export function main() {
}));
it('should support more than three queries',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var template = '<needs-four-queries #q><div text="1"></div></needs-four-queries>';
tcb.overrideTemplate(MyComp0, template)
@ -866,7 +866,7 @@ class NeedsContentChild implements AfterContentInit, AfterContentChecked {
}
get child() { return this._child; }
logs = [];
logs: any[] /** TODO #9100 */ = [];
ngAfterContentInit() { this.logs.push(["init", isPresent(this.child) ? this.child.text : null]); }
@ -895,7 +895,7 @@ class NeedsViewChild implements AfterViewInit,
}
get child() { return this._child; }
logs = [];
logs: any[] /** TODO #9100 */ = [];
ngAfterViewInit() { this.logs.push(["init", isPresent(this.child) ? this.child.text : null]); }
@ -1134,7 +1134,7 @@ class NeedsViewContainerWithRead {
@Component({selector: 'has-null-query-condition', template: '<div></div>'})
class HasNullQueryCondition {
@ContentChildren(null) errorTrigger;
@ContentChildren(null) errorTrigger: any /** TODO #9100 */;
}
@Component({
@ -1174,7 +1174,7 @@ class HasNullQueryCondition {
@Injectable()
class MyComp0 {
shouldShow: boolean;
list;
list: any /** TODO #9100 */;
constructor() {
this.shouldShow = false;
this.list = ['1d', '2d', '3d'];

View File

@ -32,7 +32,7 @@ export function main() {
log = '';
});
function logAppend(item) { log += (log.length == 0 ? '' : ', ') + item; }
function logAppend(item: any /** TODO #9100 */) { log += (log.length == 0 ? '' : ', ') + item; }
it('should support resetting and iterating over the new objects', () => {
queryList.reset(['one']);
@ -61,17 +61,17 @@ export function main() {
if (!IS_DART) {
it('should support filter', () => {
queryList.reset(['one', 'two']);
expect((<_JsQueryList>queryList).filter((x) => x == "one")).toEqual(['one']);
expect((<_JsQueryList>queryList).filter((x: any /** TODO #9100 */) => x == "one")).toEqual(['one']);
});
it('should support reduce', () => {
queryList.reset(["one", "two"]);
expect((<_JsQueryList>queryList).reduce((a, x) => a + x, "start:")).toEqual("start:onetwo");
expect((<_JsQueryList>queryList).reduce((a: any /** TODO #9100 */, x: any /** TODO #9100 */) => a + x, "start:")).toEqual("start:onetwo");
});
it('should support toArray', () => {
queryList.reset(["one", "two"]);
expect((<_JsQueryList>queryList).reduce((a, x) => a + x, "start:")).toEqual("start:onetwo");
expect((<_JsQueryList>queryList).reduce((a: any /** TODO #9100 */, x: any /** TODO #9100 */) => a + x, "start:")).toEqual("start:onetwo");
});
it('should support toArray', () => {
@ -111,7 +111,7 @@ export function main() {
}));
it('should provides query list as an argument', fakeAsync(() => {
var recorded;
var recorded: any /** TODO #9100 */;
ObservableWrapper.subscribe(queryList.changes, (v: any) => { recorded = v; });
queryList.reset(["one"]);

View File

@ -23,17 +23,17 @@ import {ComponentFactory} from '@angular/core/src/linker/component_factory';
export function main() {
describe('Compiler', () => {
var someCompFactory;
var someCompFactory: any /** TODO #9100 */;
beforeEachProviders(() => [{provide: ComponentResolver, useClass: ReflectorComponentResolver}]);
beforeEach(inject([ComponentResolver], (_compiler) => {
beforeEach(inject([ComponentResolver], (_compiler: any /** TODO #9100 */) => {
someCompFactory = new ComponentFactory(null, null, null);
reflector.registerType(SomeComponent, new ReflectionInfo([someCompFactory]));
}));
it('should read the template from an annotation',
inject([AsyncTestCompleter, ComponentResolver], (async, compiler: ComponentResolver) => {
inject([AsyncTestCompleter, ComponentResolver], (async: any /** TODO #9100 */, compiler: ComponentResolver) => {
compiler.resolveComponent(SomeComponent)
.then((compFactory: ComponentFactory<any>) => {
expect(compFactory).toBe(someCompFactory);
@ -43,7 +43,7 @@ export function main() {
}));
it('should throw when given a string',
inject([AsyncTestCompleter, ComponentResolver], (async, compiler: ComponentResolver) => {
inject([AsyncTestCompleter, ComponentResolver], (async: any /** TODO #9100 */, compiler: ComponentResolver) => {
compiler.resolveComponent("someString")
.catch((e) => {
expect(e.message).toContain("Cannot resolve component using 'someString'.")

View File

@ -54,7 +54,7 @@ function declareTests(isJit: boolean) {
beforeEachProviders(() => [{provide: PLATFORM_PIPES, useValue: [PlatformPipe], multi: true}]);
it('should overwrite them by custom pipes',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
MyComp1, new ViewMetadata({template: '{{true | somePipe}}', pipes: [CustomPipe]}))
.createAsync(MyComp1)
@ -69,7 +69,7 @@ function declareTests(isJit: boolean) {
describe('expressions', () => {
it('should evaluate conditional and boolean operators with right precedence - #8244',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp1,
new ViewMetadata({template: `{{'red' + (true ? ' border' : '')}}`}))
.createAsync(MyComp1)
@ -83,7 +83,7 @@ function declareTests(isJit: boolean) {
if (!IS_DART) {
it('should evaluate conditional and unary operators with right precedence - #8235',
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
(tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(MyComp1, new ViewMetadata({template: `{{!null?.length}}`}))
.createAsync(MyComp1)
.then((fixture) => {
@ -103,7 +103,7 @@ function declareTests(isJit: boolean) {
}
it('should support providers with an OpaqueToken that contains a `.` in the name',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var token = new OpaqueToken('a.b');
var tokenValue = 1;
createInjector(tcb, [{provide: token, useValue: tokenValue}])
@ -114,7 +114,7 @@ function declareTests(isJit: boolean) {
}));
it('should support providers with string token with a `.` in it',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var token = 'a.b';
var tokenValue = 1;
createInjector(tcb, [{provide: token, useValue: tokenValue}])
@ -125,7 +125,7 @@ function declareTests(isJit: boolean) {
}));
it('should support providers with an anonymous function',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var token = () => true;
var tokenValue = 1;
createInjector(tcb, [{provide: token, useValue: tokenValue}])
@ -136,7 +136,7 @@ function declareTests(isJit: boolean) {
}));
it('should support providers with an OpaqueToken that has a StringMap as value',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
var token1 = new OpaqueToken('someToken');
var token2 = new OpaqueToken('someToken');
var tokenValue1 = {'a': 1};
@ -153,7 +153,7 @@ function declareTests(isJit: boolean) {
});
it('should allow logging a previous elements class binding via interpolation',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideTemplate(MyComp1, `<div [class.a]="true" #el>Class: {{el.className}}</div>`)
.createAsync(MyComp1)
.then((fixture) => {
@ -164,7 +164,7 @@ function declareTests(isJit: boolean) {
}));
it('should support ngClass before a component and content projection inside of an ngIf',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async: any /** TODO #9100 */) => {
tcb.overrideView(
MyComp1, new ViewMetadata({
template: `A<cmp-content *ngIf="true" [ngClass]="'red'">B</cmp-content>C`,

View File

@ -47,11 +47,11 @@ class SecuredComponent {
constructor() { this.ctxProp = 'some value'; }
}
function itAsync(msg: string, injections: Function[], f: Function);
function itAsync(msg: string, f: (tcb: TestComponentBuilder, atc: AsyncTestCompleter) => void);
function itAsync(msg: string, injections: Function[], f: Function): any; /** TODO #???? */
function itAsync(msg: string, f: (tcb: TestComponentBuilder, atc: AsyncTestCompleter) => void): any; /** TODO #???? */
function itAsync(msg: string,
f: Function[] | ((tcb: TestComponentBuilder, atc: AsyncTestCompleter) => void),
fn?: Function) {
fn?: Function): any /** TODO #???? */ {
if (f instanceof Function) {
it(msg, inject([TestComponentBuilder, AsyncTestCompleter], <Function>f));
} else {
@ -73,7 +73,7 @@ function declareTests(isJit: boolean) {
afterEach(() => { getDOM().log = originalLog; });
itAsync('should disallow binding on*', (tcb: TestComponentBuilder, async) => {
itAsync('should disallow binding on*', (tcb: TestComponentBuilder, async: any /** TODO #???? */) => {
let tpl = `<div [attr.onclick]="ctxProp"></div>`;
tcb = tcb.overrideView(SecuredComponent, new ViewMetadata({template: tpl}));
PromiseWrapper.catchError(tcb.createAsync(SecuredComponent), (e) => {
@ -88,7 +88,7 @@ function declareTests(isJit: boolean) {
describe('safe HTML values', function() {
itAsync('should not escape values marked as trusted',
[TestComponentBuilder, AsyncTestCompleter, DomSanitizationService],
(tcb: TestComponentBuilder, async, sanitizer: DomSanitizationService) => {
(tcb: TestComponentBuilder, async: any /** TODO #???? */, sanitizer: DomSanitizationService) => {
let tpl = `<a [href]="ctxProp">Link Title</a>`;
tcb.overrideView(SecuredComponent,
new ViewMetadata({template: tpl, directives: []}))
@ -107,7 +107,7 @@ function declareTests(isJit: boolean) {
itAsync('should error when using the wrong trusted value',
[TestComponentBuilder, AsyncTestCompleter, DomSanitizationService],
(tcb: TestComponentBuilder, async, sanitizer: DomSanitizationService) => {
(tcb: TestComponentBuilder, async: any /** TODO #???? */, sanitizer: DomSanitizationService) => {
let tpl = `<a [href]="ctxProp">Link Title</a>`;
tcb.overrideView(SecuredComponent,
new ViewMetadata({template: tpl, directives: []}))
@ -125,7 +125,7 @@ function declareTests(isJit: boolean) {
});
describe('sanitizing', () => {
itAsync('should escape unsafe attributes', (tcb: TestComponentBuilder, async) => {
itAsync('should escape unsafe attributes', (tcb: TestComponentBuilder, async: any /** TODO #???? */) => {
let tpl = `<a [href]="ctxProp">Link Title</a>`;
tcb.overrideView(SecuredComponent, new ViewMetadata({template: tpl, directives: []}))
.createAsync(SecuredComponent)
@ -146,7 +146,7 @@ function declareTests(isJit: boolean) {
});
});
itAsync('should escape unsafe style values', (tcb: TestComponentBuilder, async) => {
itAsync('should escape unsafe style values', (tcb: TestComponentBuilder, async: any /** TODO #???? */) => {
let tpl = `<div [style.background]="ctxProp">Text</div>`;
tcb.overrideView(SecuredComponent, new ViewMetadata({template: tpl, directives: []}))
.createAsync(SecuredComponent)
@ -169,7 +169,7 @@ function declareTests(isJit: boolean) {
});
});
itAsync('should escape unsafe HTML values', (tcb: TestComponentBuilder, async) => {
itAsync('should escape unsafe HTML values', (tcb: TestComponentBuilder, async: any /** TODO #???? */) => {
let tpl = `<div [innerHTML]="ctxProp">Text</div>`;
tcb.overrideView(SecuredComponent, new ViewMetadata({template: tpl, directives: []}))
.createAsync(SecuredComponent)

View File

@ -137,38 +137,38 @@ class NeedsDirective {
@Directive({selector: '[needsService]'})
class NeedsService {
service: any;
constructor(@Inject("service") service) { this.service = service; }
constructor(@Inject("service") service: any /** TODO #9100 */) { this.service = service; }
}
@Directive({selector: '[needsAppService]'})
class NeedsAppService {
service: any;
constructor(@Inject("appService") service) { this.service = service; }
constructor(@Inject("appService") service: any /** TODO #9100 */) { this.service = service; }
}
@Component({selector: '[needsHostAppService]', template: '', directives: ALL_DIRECTIVES})
class NeedsHostAppService {
service: any;
constructor(@Host() @Inject("appService") service) { this.service = service; }
constructor(@Host() @Inject("appService") service: any /** TODO #9100 */) { this.service = service; }
}
@Component({selector: '[needsServiceComponent]', template: ''})
class NeedsServiceComponent {
service: any;
constructor(@Inject("service") service) { this.service = service; }
constructor(@Inject("service") service: any /** TODO #9100 */) { this.service = service; }
}
@Directive({selector: '[needsServiceFromHost]'})
class NeedsServiceFromHost {
service: any;
constructor(@Host() @Inject("service") service) { this.service = service; }
constructor(@Host() @Inject("service") service: any /** TODO #9100 */) { this.service = service; }
}
@Directive({selector: '[needsAttribute]'})
class NeedsAttribute {
typeAttribute;
titleAttribute;
fooAttribute;
typeAttribute: any /** TODO #9100 */;
titleAttribute: any /** TODO #9100 */;
fooAttribute: any /** TODO #9100 */;
constructor(@Attribute('type') typeAttribute: String, @Attribute('title') titleAttribute: String,
@Attribute('foo') fooAttribute: String) {
this.typeAttribute = typeAttribute;
@ -179,31 +179,31 @@ class NeedsAttribute {
@Directive({selector: '[needsAttributeNoType]'})
class NeedsAttributeNoType {
fooAttribute;
constructor(@Attribute('foo') fooAttribute) { this.fooAttribute = fooAttribute; }
fooAttribute: any /** TODO #9100 */;
constructor(@Attribute('foo') fooAttribute: any /** TODO #9100 */) { this.fooAttribute = fooAttribute; }
}
@Directive({selector: '[needsElementRef]'})
class NeedsElementRef {
elementRef;
elementRef: any /** TODO #9100 */;
constructor(ref: ElementRef) { this.elementRef = ref; }
}
@Directive({selector: '[needsViewContainerRef]'})
class NeedsViewContainerRef {
viewContainer;
viewContainer: any /** TODO #9100 */;
constructor(vc: ViewContainerRef) { this.viewContainer = vc; }
}
@Directive({selector: '[needsTemplateRef]'})
class NeedsTemplateRef {
templateRef;
templateRef: any /** TODO #9100 */;
constructor(ref: TemplateRef<Object>) { this.templateRef = ref; }
}
@Directive({selector: '[optionallyNeedsTemplateRef]'})
class OptionallyNeedsTemplateRef {
templateRef;
templateRef: any /** TODO #9100 */;
constructor(@Optional() ref: TemplateRef<Object>) { this.templateRef = ref; }
}
@ -244,7 +244,7 @@ class PipeNeedsChangeDetectorRef {
@Pipe({name: 'pipeNeedsService'})
export class PipeNeedsService implements PipeTransform {
service: any;
constructor(@Inject("service") service) { this.service = service; }
constructor(@Inject("service") service: any /** TODO #9100 */) { this.service = service; }
transform(value: any): any { return this; }
}
@ -289,7 +289,7 @@ export function main() {
beforeEachProviders(() => [{provide: "appService", useValue: 'appService'}]);
beforeEach(inject([TestComponentBuilder], (_tcb) => { tcb = _tcb; }));
beforeEach(inject([TestComponentBuilder], (_tcb: any /** TODO #9100 */) => { tcb = _tcb; }));
describe("injection", () => {
it("should instantiate directives that have no dependencies", fakeAsync(() => {
@ -336,7 +336,7 @@ export function main() {
{provide: 'injectable1', useValue: 'new-injectable1'},
{
provide: 'injectable2',
useFactory: (val) => `${val}-injectable2`,
useFactory: (val: any /** TODO #9100 */) => `${val}-injectable2`,
deps: [
[
new InjectMetadata('injectable1'),
@ -352,7 +352,7 @@ export function main() {
it("should instantiate providers that have dependencies", fakeAsync(() => {
var providers = [
{provide: 'injectable1', useValue: 'injectable1'},
{provide: 'injectable2', useFactory: (val) => `${val}-injectable2`, deps: ['injectable1']}
{provide: 'injectable2', useFactory: (val: any /** TODO #9100 */) => `${val}-injectable2`, deps: ['injectable1']}
];
var el = createComp('<div simpleDirective></div>',
tcb.overrideProviders(SimpleDirective, providers));
@ -362,7 +362,7 @@ export function main() {
it("should instantiate viewProviders that have dependencies", fakeAsync(() => {
var viewProviders = [
{provide: 'injectable1', useValue: 'injectable1'},
{provide: 'injectable2', useFactory: (val) => `${val}-injectable2`, deps: ['injectable1']}
{provide: 'injectable2', useFactory: (val: any /** TODO #9100 */) => `${val}-injectable2`, deps: ['injectable1']}
];
var el = createComp('<div simpleComponent></div>',