Reputation: 1060
Based on material 2 demo-app i have created a demo for expand-all/collapse-all funcationality for matAccordian.
https://stackblitz.com/edit/angular-jmitne?file=app/expansion-overview-example.html
expandall button isn't working as it unable to find accordion.openAll() function. I have seen openAll() is defined in the CdkAccordion class which is being inherited by MatAccordion, but somehow it doesn't seem to work.
Upvotes: 0
Views: 6401
Reputation: 26750
The reason why it doesn't work is because such functionality has only been released in 6.0.0-beta.0
and your Stackblitz is still on 5.2.1
. (see this commit for more info).
Here's the changelog (v6.0.0-beta.0
) for more info.
P.s. did you know you can install specific versions of a dependency on Stackblitz?
Upvotes: 2