#Render component html into textarea

7 messages · Page 1 of 1 (latest)

hollow plover
#

Hi All,

Is it possible to render a component inside of a textarea? I just want the HTML dumped into the textarea.

myComponent
<h1 style="font-size:100px">Test</h1>

<textarea><myComponent></myComponent></textarea>

lusty lintel
#

Hi, a textarea is meant to provide a text input on multiple lines. What are you trying to achieve?

hollow plover
#

Just trying to dump the HTML that the component generates. That way the user can copy it

lusty lintel
#

It can't work, you need to implement your own logic to get the html version of the rendered component

primal reef
#

Maybe a "dumb" elementRef.nativeElement.outerHTML

#

or inner

#

You'll likely get a lot of "garbage" attributes/classes/etc though