goetzrobin / spartan

Cutting-edge tools powering Angular full-stack development.
https://spartan.ng
MIT License
1.13k stars 123 forks source link

feat(accordion): set `state` property on items directly #163

Closed alexciesielski closed 4 months ago

alexciesielski commented 4 months ago

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

Which package are you modifying?

What is the current behavior?

I'm building an expandable menu for (nested) router links in my app and need the ability to set the state of a particular accordion item through an Angular input, which currently isn't possible.

This change moves the state handling responsibility down to the individual items and the parent is only informed through signal emissions about which item is open/closed.

Does this PR introduce a breaking change?

Other information

Coming from a pure rxjs background I'm only starting to learn how to work with Signals, and definitely still struggle.

Would appreciate any suggestions on how to write this cleaner.