0

Is it possible to reneder value from any external source (database, files, etc.) like 'some text' on page as pure HTML with using LIT-HTML? I'm trying to do it by assinging this value to variable like that:

var variable = html `{$database.value}`

but it doesn't work. I still see text on the page instead of HTML tags (div, a)

abraham
  • 46,583
  • 10
  • 100
  • 152
Piotr Treska
  • 63
  • 1
  • 5
  • `$database` seems php, is it server-side or client-side code? Or you meant ``html`${database.value}` ``? – Umbo Feb 20 '19 at 16:57

1 Answers1

0

You can use the unsafeHTML directive for this: https://lit-html.polymer-project.org/guide/template-reference#unsafehtml