Added null check

This commit is contained in:
Zakary Timson 2019-04-21 18:24:48 -04:00
parent 6d4db7060b
commit 876fdab031

View File

@ -14,7 +14,7 @@ export class TypewriterComponent {
@Input() @Input()
set text(text: string) { 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<string>; output: Observable<string>;