Possibly, but the short answer is no. There is currently no way to statically import html content into a js file natively. It will need to be a js file that exports your html template.
I suspect you could write your own custom build step to transpile the contents of an html file to a template, but that may be more trouble than its worth if there isnt already a package for it. On Wed, Sep 5, 2018, 4:35 AM <[email protected]> wrote: > Hi there, > > i'm still confused. I try to extract the html template from my polymer > component into a standalone html file. For polymer 2 i found some examples, > but they don't work for my polymer 3 project. I tried something like the > following, but it fails. > > import * as template from './pm.template.html'; > > .... > > static get template() { > return template; > } > > > > So as simple question, it is possible to separate the template as html > file (not a js file) & if yes, how? > > Thanks for your help > > ciao Torsten > > Follow Polymer on Google+: plus.google.com/107187849809354688692 > --- > You received this message because you are subscribed to the Google Groups > "Polymer" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/polymer-dev/b21b72ed-ff8f-4dcf-a779-33ccdb192674%40googlegroups.com > <https://groups.google.com/d/msgid/polymer-dev/b21b72ed-ff8f-4dcf-a779-33ccdb192674%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > Follow Polymer on Google+: plus.google.com/107187849809354688692 --- You received this message because you are subscribed to the Google Groups "Polymer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/CAFfkm%3DJsS__VB24e56C-oUfZSs%2BZHVR-knqECbTiQujvs%2BrEEQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
