refactor(aria/accordion): Replace ContentChildren with manual registration of triggers#33027
Conversation
|
Deployed dev-app for 83047db to: https://ng-dev-previews-comp--pr-angular-components-33027-dev-c88iotjr.web.app Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt. |
|
Deployed docs-preview for 83047db to: https://ng-dev-previews-comp--pr-angular-components-33027-docs-b4xz8ja3.web.app Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt. |
3e4ce9c to
65a56ad
Compare
cfac5c7 to
07f7d82
Compare
7b50c3a to
3878c11
Compare
3ab919e to
4191929
Compare
…ggers and factor and clean up test methods
…ation of triggers
5f96f3d to
83047db
Compare
|
This PR was merged into the repository. The changes were merged into the following branches:
|
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Fixes 32995 where contentChildren for linking triggers with the parent group does not work when the directive is used within another component.
Instead, adopt registration pattern like in other components for each trigger to register with the group.
Added tests to verify correct updating of references in cases when the triggers are set up in a loop and then updated, when included in if blocks and removed/re-inserted. Also cleaned up a lot of the test code in general and also to use signals and to test updates in a more natural manner.
Using exsting registration pattern as-is actually does not work with the above tests, so added an index property to AccordionTrigger which should be set when triggers created dynamically (with $index). When this is updated, it will force a refresh of the computed signals driving the patterns.