aurelia / aurelia/templating

Support nested elements on @child and @children

Open
#604 7 comments 4 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
113
Forks
101
PR merge metrics
No merged PRs in 30d

Description

**I'm submitting a feature request**

**Current behavior:**

`@children` and `@child` select immediate children only.

* **What is the expected behavior?**

`@children` and `@child` should select arbitrary nested children.

* **What is the motivation / use case for changing the behavior?**

This is a great and important feature, and it is a shame that it boxes you into structuring your markup a particular way.

If the reason for limiting to immediate children was performance, this could be configurable:

```javascript
@children('my-element') a; // immediate children
@children({ selector: 'my-element', recursive: true }) b; // all children
```

Contributor guide

Open the contributing guide

Research direction

Start by locating the implementations and tests for @child and @children, then trace how they currently limit selection to immediate children. Define and verify the expected behavior for arbitrary nesting while preserving existing immediate-child behavior, including whether recursive selection should be configurable as suggested.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.