Dynamic nested Material menu from json object in Angular 5

后端 未结 2 1109
轻奢々
轻奢々 2021-01-31 09:09

How to create dynamic nested menu from json object?

I started using Angular Material Design today for the first time and I\'m trying to create nested menus using materia

2条回答
  •  梦谈多话
    2021-01-31 09:32

    The following structure should work for you:

    
    
    
      
        
        
           
        
      
    
    

    Since I placed sub_menu inside the embedded template (*ngFor) we can use the same name for template reference variable(#sub_menu).

    Stackblitz Example

提交回复
热议问题