question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

html` ${html`<something property=${object} />`} `

See original GitHub issue

When nesting html`` -tags, properties get stringified, objects will appear as [object Object]

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
TimvdLippecommented, Jun 10, 2018

You should not call join to get a string, but just pass in the array directly: https://codepen.io/anon/pen/OEWGKX?editors=1000

On Sun, 10 Jun 2018, 19:46 Josh Beckwith, notifications@github.com wrote:

Here’s a repro: https://codepen.io/positlabs/pen/BVpEOj?editors=1000

Is there a recommended way of handling loops within the html template strings? I remember dom-repeat(?) in polymer, but I’d rather not use that.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Polymer/lit-element/issues/82#issuecomment-396067698, or mute the thread https://github.com/notifications/unsubscribe-auth/AFrDb3S_a5cGYk5cjC56d2nK1tGdiUEpks5t7VuBgaJpZM4UWvJL .

1reaction
yorrdcommented, Jun 3, 2018

@jsilvermist yes and when I use a function which wraps the html`` call within another one, any object property I use is stringified. If you can’t reproduce it, let me know, I’ll throw together a reproduction

Read more comments on GitHub >

github_iconTop Results From Across the Web

html ${html <something property=${object} /> } #82 - GitHub
When nesting html`` -tags, properties get stringified, objects will appear as [object Object]
Read more >
HTML object tag - W3Schools
HTML <object> Tag · Definition and Usage. The <object> tag defines a container for an external resource. · Plug-ins. The <object> tag was...
Read more >
CueKeeper internals: Experiences with Irmin, React, TyXML ...
It stores your actions in a Git-like data-store provided by Irmin, allowing you to browse the history, revert changes, and sync (between tabs ......
Read more >
Modern JavaScript: Develop and Design - Pepa
it comes to using JavaScript with HTML in a Web page. The last chapter in Part ... someMethod()to execute the function defined within...
Read more >
[Biopython] saving tree data in phyloXML format
For each clade in the > tree I am adding a node_id attribute and one Property object. When I print > the tree...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found