I am conditionally adding title attributes to elements like so:
<div #optionEl class="option-title" [attr.title]="isTitleTruncated(optionEl) ? option.title : null">
{{option.title}}
</div>
which calls:
isTitleTruncated(e) {
return (e.offsetWidth < e.scrollWidth);
}
For cases where the title does get applied, getting:
Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'title: null'. Current value: 'title: A very long piece of text'
I'm unsure why this is happening, can someone point out why or what could be the possible reasons?