Svelte bindings within template literals

Viewed 12

I am trying to bind the textarea element inside a template string. But when i console.log the binded element, I get undefined. Does svelte bindings work inside template string?

let el 

var html = `

<textarea type="text" df-name rows="5" class="auto_height bg-transparent text-xl focus:outline-none resize-none " bind:this=${el} on:input=${ console.log(el)}>
`;

//console.log output 'undefined'
1 Answers

This will not work, it will not be compiled and none of the Svelte features will be available.

Related