diff --git a/src/lib/directives/ng2-fittext.directive.ts b/src/lib/directives/ng2-fittext.directive.ts index 331783c..1c3709b 100644 --- a/src/lib/directives/ng2-fittext.directive.ts +++ b/src/lib/directives/ng2-fittext.directive.ts @@ -143,13 +143,13 @@ export class Ng2FittextDirective getStartFontSizeFromHeight(): number { return this.container ? this.container.clientHeight - : this.el.nativeElement.parentElement.clientHeight; + : this.el.nativeElement.parentElement!.clientHeight; } private getStartFontSizeFromWeight(): number { return this.container ? this.container.clientWidth - : this.el.nativeElement.parentElement.clientWidth; + : this.el.nativeElement.parentElement!.clientWidth; } isDone(): boolean { @@ -164,7 +164,7 @@ export class Ng2FittextDirective return this.container ? this.checkOverflow(this.container, this.el.nativeElement) : this.checkOverflow( - this.el.nativeElement.parentElement, + this.el.nativeElement.parentElement!, this.el.nativeElement ); }