Expression has changed after it was checked error

113 Views Asked by At

I make code that popup tooltip if there are overflow in the element and dont show tooltip if there are no overflow

<div class="title">
<div #titleElement class="ttt" [innerHtml]="title" data-toggle="tooltip" 
data- placement="bottom" [title]=isOverflown(titleElement)?title:null></div>
</div>

type script code :

isOverflown(titleElement) {
return titleElement.scrollHeight > titleElement.clientHeight || 
titleElement.scrollWidth > titleElement.clientWidth ;
}

but just if the element has overflow it's case console error : Expression has changed after it was checked enter image description here

0

There are 0 best solutions below