From 2fa8df499f74f18b171e0cff8d4991e92a48053a Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Tue, 30 Oct 2018 21:15:16 +0000 Subject: [PATCH] fix(time-ago): typescript error --- src/time-ago.pipe.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/time-ago.pipe.ts b/src/time-ago.pipe.ts index 5c6dad0..751b4eb 100644 --- a/src/time-ago.pipe.ts +++ b/src/time-ago.pipe.ts @@ -7,7 +7,7 @@ const momentConstructor = moment; @Pipe({name: 'amTimeAgo', pure: false}) export class TimeAgoPipe implements PipeTransform, OnDestroy { - private currentTimer: number; + private currentTimer: number | null; private lastTime: Number; private lastValue: Date | moment.Moment; @@ -55,6 +55,8 @@ export class TimeAgoPipe implements PipeTransform, OnDestroy { this.currentTimer = null; this.ngZone.run(() => this.cdRef.markForCheck()); }, timeToUpdate); + } else { + return null; } }); }