How to toggle Angular material expansion panel programmatically

前端 未结 6 1130
半阙折子戏
半阙折子戏 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:14

    Another very simple way to handle Mat Expansion panel programmatically is by using local references in Angular

    
      
      
    
    

    Now in HTML(not accessible directly in TS file until we use @ViewChild) file use mep to expand or collapse Expansion panel using something like this:

    
     
    

提交回复
热议问题