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; } }); }