Added null check
This commit is contained in:
		@@ -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>;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user