Copy attributes on <template> to <router-view> and <compose>
- Dominant language
- TypeScript
- Stars
- 113
- Forks
- 101
- PR merge metrics
- No merged PRs in 30d
Description
**I'm submitting a feature request**
When creating a custom element, any attributes placed on its `` element will be copied to the actual element. I'd like to see the same behavior for views presented in a `` or using ``.
**Current behavior:**
Currently, attributes placed on the `` element are completely ignored when the view is presented in a `` or `` element.
**Expected/desired behavior:**
* **What is the expected behavior?**
The attributes placed on the `` element of a view presented either in a `` or using ``, should be copied to that `` or `` element - exactly the same behavior as what is currently implemented for custom elements.
Attributes or styles should not be overwritten - i.e. if an attribute or style is specified on both the `` element and on the `` or `` element, then the attribute should _not_ be copied - exactly the same behavior as what is currently implemented for custom elements.
When the view is changed/removed, any attributes, class names or styles that were _added_ should be _removed_, thus reverting the `` or `` element to its original state - this is, I believe, the only difference compared to custom elements.
* **What is the motivation / use case for changing the behavior?**
This was previously discussed here: https://github.com/aurelia/framework/issues/139#issuecomment-269750536
Contributor guide
Research direction
The issue names no files or tests; start by tracing the existing custom-element attribute-copying behavior, then follow the rendering paths for and . Done means template attributes are copied without overwriting existing attributes or styles, and attributes, classes, and styles added by the view are removed when it changes or is removed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100