typescript - Använd Angulars interpolation för data-tippy-content


Jag arbetar på ett Angular-projekt och har tippy.js som fungerar bra ( https://atomiks.github.io ).

Problemet är att jag behöver fylla verktygstipsen med viss JSON-information som jag skulle kunna placera med Angulars interpolation, men följande felmeddelande visas: "Kan inte binda till 'tippy-content' eftersom det inte är en känd egenskap för 'div'."

<div data-tippy-content="{{top.description}}" data-tippy-placement="right" class="layout-tops-photos theme-tops-photos theme-hover js-tippy"></div>

Finns det ett sätt att få det att fungera med interpolation? Om inte, finns det ett annat sätt?

Svar #1

Använd syntax för attributbindning

<div attr.data-tippy-content="{{top.description}}" data-tippy-placement="right" class="layout-tops-photos theme-tops-photos theme-hover js-tippy"></div>