fix: broken build due to bad noImplicitAny merge

This commit is contained in:
Misko Hevery 2016-06-10 10:35:36 -07:00
parent 164a091c71
commit 9c0031f7a5

View File

@ -96,8 +96,11 @@ export function main() {
})); }));
it('should display template if context is null', it('should display template if context is null',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => { inject(
var template = `<tpl-refs #refs="tplRefs"><template>foo</template></tpl-refs><template [ngTemplateOutlet]="currentTplRef" [ngOutletContext]="null"></template>`; [TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async: AsyncTestCompleter) => {
var template =
`<tpl-refs #refs="tplRefs"><template>foo</template></tpl-refs><template [ngTemplateOutlet]="currentTplRef" [ngOutletContext]="null"></template>`;
tcb.overrideTemplate(TestComponent, template) tcb.overrideTemplate(TestComponent, template)
.createAsync(TestComponent) .createAsync(TestComponent)
.then((fixture) => { .then((fixture) => {
@ -116,8 +119,11 @@ export function main() {
})); }));
it('should reflect initial context and changes', it('should reflect initial context and changes',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => { inject(
var template =`<tpl-refs #refs="tplRefs"><template let-foo="foo"><span>{{foo}}</span></template></tpl-refs><template [ngTemplateOutlet]="currentTplRef" [ngOutletContext]="context"></template>`; [TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async: AsyncTestCompleter) => {
var template =
`<tpl-refs #refs="tplRefs"><template let-foo="foo"><span>{{foo}}</span></template></tpl-refs><template [ngTemplateOutlet]="currentTplRef" [ngOutletContext]="context"></template>`;
tcb.overrideTemplate(TestComponent, template) tcb.overrideTemplate(TestComponent, template)
.createAsync(TestComponent) .createAsync(TestComponent)
.then((fixture) => { .then((fixture) => {
@ -139,8 +145,11 @@ export function main() {
})); }));
it('should reflect user defined $implicit property in the context', it('should reflect user defined $implicit property in the context',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => { inject(
var template =`<tpl-refs #refs="tplRefs"><template let-ctx><span>{{ctx.foo}}</span></template></tpl-refs><template [ngTemplateOutlet]="currentTplRef" [ngOutletContext]="context"></template>`; [TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async: AsyncTestCompleter) => {
var template =
`<tpl-refs #refs="tplRefs"><template let-ctx><span>{{ctx.foo}}</span></template></tpl-refs><template [ngTemplateOutlet]="currentTplRef" [ngOutletContext]="context"></template>`;
tcb.overrideTemplate(TestComponent, template) tcb.overrideTemplate(TestComponent, template)
.createAsync(TestComponent) .createAsync(TestComponent)
.then((fixture) => { .then((fixture) => {
@ -149,7 +158,9 @@ export function main() {
var refs = fixture.debugElement.children[0].references['refs']; var refs = fixture.debugElement.children[0].references['refs'];
fixture.componentInstance.currentTplRef = refs.tplRefs.first; fixture.componentInstance.currentTplRef = refs.tplRefs.first;
fixture.componentInstance.context = { $implicit: fixture.componentInstance.context }; fixture.componentInstance.context = {
$implicit: fixture.componentInstance.context
};
fixture.detectChanges(); fixture.detectChanges();
expect(fixture.debugElement.nativeElement).toHaveText('bar'); expect(fixture.debugElement.nativeElement).toHaveText('bar');
@ -158,8 +169,11 @@ export function main() {
})); }));
it('should reflect context re-binding', it('should reflect context re-binding',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => { inject(
var template =`<tpl-refs #refs="tplRefs"><template let-shawshank="shawshank"><span>{{shawshank}}</span></template></tpl-refs><template [ngTemplateOutlet]="currentTplRef" [ngOutletContext]="context"></template>`; [TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async: AsyncTestCompleter) => {
var template =
`<tpl-refs #refs="tplRefs"><template let-shawshank="shawshank"><span>{{shawshank}}</span></template></tpl-refs><template [ngTemplateOutlet]="currentTplRef" [ngOutletContext]="context"></template>`;
tcb.overrideTemplate(TestComponent, template) tcb.overrideTemplate(TestComponent, template)
.createAsync(TestComponent) .createAsync(TestComponent)
.then((fixture) => { .then((fixture) => {
@ -167,12 +181,12 @@ export function main() {
var refs = fixture.debugElement.children[0].references['refs']; var refs = fixture.debugElement.children[0].references['refs'];
fixture.componentInstance.currentTplRef = refs.tplRefs.first; fixture.componentInstance.currentTplRef = refs.tplRefs.first;
fixture.componentInstance.context = { shawshank: 'brooks' }; fixture.componentInstance.context = {shawshank: 'brooks'};
fixture.detectChanges(); fixture.detectChanges();
expect(fixture.debugElement.nativeElement).toHaveText('brooks'); expect(fixture.debugElement.nativeElement).toHaveText('brooks');
fixture.componentInstance.context = { shawshank: 'was here' }; fixture.componentInstance.context = {shawshank: 'was here'};
fixture.detectChanges(); fixture.detectChanges();
expect(fixture.debugElement.nativeElement).toHaveText('was here'); expect(fixture.debugElement.nativeElement).toHaveText('was here');
@ -192,5 +206,5 @@ class CaptureTplRefs {
@Component({selector: 'test-cmp', directives: [NgTemplateOutlet, CaptureTplRefs], template: ''}) @Component({selector: 'test-cmp', directives: [NgTemplateOutlet, CaptureTplRefs], template: ''})
class TestComponent { class TestComponent {
currentTplRef: TemplateRef<any>; currentTplRef: TemplateRef<any>;
context: any = { foo: 'bar' }; context: any = {foo: 'bar'};
} }