我对angular并不陌生,我正在根据下面的数据创建一个动态/嵌套菜单。我包括我开始使用的代码。任何帮助表示赞赏。 以下是我的json数据:
dataList = [
{List: 'List 1', Client: 'Client A', Program: 'Client A Program 1'},
{List: 'List 2', Client: 'Client A', Program: 'Client A Program 1'},
{List: 'List 3', Client: 'Client A', Program: 'Client A Program 2'},
{List: 'List 4', Client: 'Client A', Program: 'Client A Program 2'},
{List: 'List 5', Client: 'Client B', Program: 'Client B Program 1'},
{List: 'List 6', Client: 'Client B', Program: 'Client B Program 1'},
];
这是我到目前为止开始的事情:
<ng-container *ngFor="let item of dataList>
<div class="clientList">
<button mat-menu-item [routerLink]="['/home']" color="primary" (click)="menuClick()"><i class="fa object_group"
aria-hidden="true"></i> {{item.Client}}</button>
</div>
</ng-container>
我想要一个如下所示的棱角材质菜单: https://imgur.com/a/WGpYRlK