donejs / done-component

A plugin for creating <can-component>s
https://www.npmjs.com/package/done-component
MIT License
8 stars 2 forks source link

tags being stripped out of strings in the <view-model> #72

Open nlundquist opened 6 years ago

nlundquist commented 6 years ago

When using a .component based file, tag strings are being stripped out of the JavaScript within the <view-model> section.

For example a component that appends an h1 tag to an element will end up only appending the contents of the h1, since the tag itself has been removed from the loaded JS. Looking at the loaded JS (/test-parent.component.view-model!eval in the example) you can see the tag is missing.

see the code at: https://glitch.com/edit/#!/tender-alligator & the running example at: https://tender-alligator.glitch.me/

nlundquist commented 6 years ago

stache tags are also being stripped out of the rendered content :(

a function in a view model like: buttonHandler() { renderSidePanel('{{close-button}} <my-component>'); } would render as: buttonHandler() { renderSidePanel(' <my-component>'); }