Here is a code snippet that I am struggling with:
{{ Name && Name.length > 20 ? (Name | slice: 0:20) + "..." : Name }}
The above code works fine when used inside a div, but when I try to use it within innerHTML, I encounter a syntax error.
<div [innerHTML]='Name && Name.length > 20) ? "(Name| slice: 0:20 + "..."" : "Name"'>
</div>
I would appreciate any help or suggestions on how to fix this issue. Thank you.