角度材质模板mat-menu为空

时间:2018-05-24 19:26:06

标签: html angular

Serial返回*ngIf="cards[i].vm_type === 'Container Provider'"时,我无法看到True选项我不确定我在这里做错了什么。 empty contents when clicking on Connect when vm.vm_type is Bhyve

contents when clicking on Connect when vm.vm_type is Container Provide

          <button mat-raised-button color="primary" [disabled]="(cards[i].state == 'stopped')" [matMenuTriggerFor]="appMenu">Connect</button>
            <mat-menu #appMenu="matMenu">
              <button *ngIf="cards[i].vm_type === 'Bhyve'" mat-menu-item color="primary" [disabled]="(!cards[i].vnc || cards[i].state === 'stopped')" (click)="vnc(i)">VNC</button>
              <button *ngIf="cards[i].vm_type === 'Bhyve'" mat-menu-item color="primary" [disabled]="(cards[i].state === 'stopped')" (click)="serial(i)">Serial</button>
            </mat-menu>
            <mat-menu  #appMenu="matMenu">
              <button *ngIf="cards[i].vm_type === 'Container Provider'" mat-menu-item color="primary" [disabled]="(cards[i].state === 'stopped')" (click)="serial(i)">Serial</button>
            </mat-menu>

1 个答案:

答案 0 :(得分:1)

NVM我明白了

              <button *ngIf="cards[i].vm_type === 'Bhyve'" mat-raised-button color="primary" [disabled]="(cards[i].state == 'stopped')" [matMenuTriggerFor]="appMenu">Connect</button>
            <mat-menu #appMenu="matMenu">
              <button  mat-menu-item color="primary" [disabled]="(!cards[i].vnc || cards[i].state === 'stopped')" (click)="vnc(i)">VNC</button>
              <button  mat-menu-item color="primary" [disabled]="(cards[i].state === 'stopped')" (click)="serial(i)">Serial</button>
            </mat-menu>
          <button *ngIf="cards[i].vm_type === 'Container Provider'" mat-raised-button color="primary" [disabled]="(cards[i].state == 'stopped')" [matMenuTriggerFor]="appMenu2">Connect</button>
            <mat-menu  #appMenu2="matMenu">
              <button mat-menu-item color="primary" [disabled]="(cards[i].state === 'stopped')" (click)="serial(i)">Serial</button>
            </mat-menu>