use of template parts in recursive templates
- Dominant language
- TypeScript
- Stars
- 113
- Forks
- 101
- PR merge metrics
- No merged PRs in 30d
Description
To render a tree view, I have built a custom element with the following recursive HTML template.
treeview.html
``` html
-
${item.text}
```
Users should be able to overwrite the default text rendering by providing a custom HTML template. For the top level items, this can be easily achieved using a template part (called "item-text" in my example). Is there a way to pass the same template to the recursive instantiation of the element so that the text of the children is rendered in the same way?
Contributor guide
Research direction
Start with treeview.html and trace how the "item-text" template part is resolved for the top-level custom element and how the recursive instance is created. Determine how the same part could reach child instances, then verify that custom item rendering is preserved at every tree depth.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100