0

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

ali amer
  • 65
  • 9
  • This [Blog](https://blog.angularindepth.com/everything-you-need-to-know-about-the-expressionchangedafterithasbeencheckederror-error-e3fd9ce7dbb4) includes explanation and solution – Vikas Jun 23 '18 at 06:44
  • it's not useful – ali amer Jun 23 '18 at 13:03

0 Answers0