diff --git a/modules/@angular/common/src/pipes/async_pipe.ts b/modules/@angular/common/src/pipes/async_pipe.ts index 59af55ab80..3c21fd13c0 100644 --- a/modules/@angular/common/src/pipes/async_pipe.ts +++ b/modules/@angular/common/src/pipes/async_pipe.ts @@ -82,6 +82,9 @@ export class AsyncPipe implements OnDestroy, PipeTransform { } } + transform(obj: Observable): T|null; + transform(obj: Promise): T|null; + transform(obj: EventEmitter): T|null; transform(obj: Observable|Promise|EventEmitter): any { if (!this._obj) { if (obj) { @@ -93,7 +96,7 @@ export class AsyncPipe implements OnDestroy, PipeTransform { if (obj !== this._obj) { this._dispose(); - return this.transform(obj); + return this.transform(obj as any); } if (this._latestValue === this._latestReturnedValue) { diff --git a/tools/public_api_guard/common/index.d.ts b/tools/public_api_guard/common/index.d.ts index c86bbffa57..5a81a9b079 100644 --- a/tools/public_api_guard/common/index.d.ts +++ b/tools/public_api_guard/common/index.d.ts @@ -5,7 +5,9 @@ export declare const APP_BASE_HREF: InjectionToken; export declare class AsyncPipe implements OnDestroy, PipeTransform { constructor(_ref: ChangeDetectorRef); ngOnDestroy(): void; - transform(obj: Observable | Promise | EventEmitter): any; + transform(obj: EventEmitter): T | null; + transform(obj: Promise): T | null; + transform(obj: Observable): T | null; } /** @stable */