How to toggle Angular material expansion panel programmatically

前端 未结 6 1206
半阙折子戏
半阙折子戏 2021-02-12 16:20

I just started working on an Angular 4 project with material design.

I am currently working with the expansion component, the API states that a disabled expansion pa

6条回答
  •  名媛妹妹
    2021-02-12 17:06

    You can set a var, in this case I used "isExpanded" then use it to open and close set the boolean value.

    
    
    

    If you want to use it with the integrated toogle button instead you must update the "isExpanded" var with the "(opened)" and "(closed)" hooks from mat-expansion-panel.

    
    
    

提交回复
热议问题