diff --git a/src/app/components/typewriter/typewriter.component.ts b/src/app/components/typewriter/typewriter.component.ts index 502ec83..c8982a6 100644 --- a/src/app/components/typewriter/typewriter.component.ts +++ b/src/app/components/typewriter/typewriter.component.ts @@ -14,7 +14,7 @@ export class TypewriterComponent { @Input() set text(text: string) { - this.output = timer(this.delay, this.speed).pipe(filter(n => n <= text.length), map(n => text.slice(0, n))); + this.output = timer(this.delay, this.speed).pipe(filter(n => n <= (text.length || 0)), map(n => text.slice(0, n))); } output: Observable;