From 94b62c963d8bdfa9edfa70b9243d722aaca73e13 Mon Sep 17 00:00:00 2001 From: WilliamKoza Date: Sat, 21 Jan 2017 11:27:42 +0100 Subject: [PATCH] fix(common) add interface PipeTransform to Async pipe (#14049) PR Close #14049 --- modules/@angular/common/src/pipes/async_pipe.ts | 6 +++--- tools/public_api_guard/common/index.d.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/@angular/common/src/pipes/async_pipe.ts b/modules/@angular/common/src/pipes/async_pipe.ts index e319f20fac..b923d6e11f 100644 --- a/modules/@angular/common/src/pipes/async_pipe.ts +++ b/modules/@angular/common/src/pipes/async_pipe.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {ChangeDetectorRef, OnDestroy, Pipe, WrappedValue} from '@angular/core'; +import {ChangeDetectorRef, OnDestroy, Pipe, PipeTransform, WrappedValue} from '@angular/core'; import {EventEmitter, Observable} from '../facade/async'; import {isPromise} from '../private_import_core'; import {InvalidPipeArgumentError} from './invalid_pipe_argument_error'; @@ -66,7 +66,7 @@ const _observableStrategy = new ObservableStrategy(); * @stable */ @Pipe({name: 'async', pure: false}) -export class AsyncPipe implements OnDestroy { +export class AsyncPipe implements OnDestroy, PipeTransform { private _latestValue: Object = null; private _latestReturnedValue: Object = null; @@ -131,7 +131,7 @@ export class AsyncPipe implements OnDestroy { this._obj = null; } - private _updateLatestValue(async: any, value: Object) { + private _updateLatestValue(async: any, value: Object): void { if (async === this._obj) { this._latestValue = value; this._ref.markForCheck(); diff --git a/tools/public_api_guard/common/index.d.ts b/tools/public_api_guard/common/index.d.ts index 3419149a77..d75bf6544b 100644 --- a/tools/public_api_guard/common/index.d.ts +++ b/tools/public_api_guard/common/index.d.ts @@ -2,7 +2,7 @@ export declare const APP_BASE_HREF: InjectionToken; /** @stable */ -export declare class AsyncPipe implements OnDestroy { +export declare class AsyncPipe implements OnDestroy, PipeTransform { constructor(_ref: ChangeDetectorRef); ngOnDestroy(): void; transform(obj: Observable | Promise | EventEmitter): any;