You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A nice improvement made in v2 is to be able to insert a templated element back where it originally came from, without having to select its parent in any way. It does this by storing a reference to its parent as it gets extracted from the DOM into the Template object.
Then when you come to add it back to the page, you can do this:
Once the first conversation element has been inserted, should inserting message-item elements go into the original, or the latest added? If the latter, how do we define this?
It might make most sense to do something like the following:
Templated elements need to remember their ancestors with data-template attributes.
When being inserted, templated elements need to search for the latest-added data-template ancestor.
Some clever XPath here?
The text was updated successfully, but these errors were encountered:
A nice improvement made in v2 is to be able to insert a templated element back where it originally came from, without having to select its parent in any way. It does this by storing a reference to its parent as it gets extracted from the DOM into the Template object.
Then when you come to add it back to the page, you can do this:
The
insert
part was crucial - rather thanappend
, it remembers the sibling element too in order to keep its original place.But the question is, where does (or should) the template named "message-item" get inserted in the following example:
Once the first
conversation
element has been inserted, should insertingmessage-item
elements go into the original, or the latest added? If the latter, how do we define this?It might make most sense to do something like the following:
data-template
attributes.The text was updated successfully, but these errors were encountered: