Angular 与ng模板一起使用时,不会触发mat按钮单击

Angular 与ng模板一起使用时,不会触发mat按钮单击,angular,angular-material,ng-template,Angular,Angular Material,Ng Template,我有以下代码结构: <div class="tile panel-container preview" *ngIf="dataSource?.length > 0"> <ng-container *ngIf="uploadPercentage; then loadBlock; else successLoadBlock"></ng-container> <button mat-bu

我有以下代码结构:

<div class="tile panel-container preview" *ngIf="dataSource?.length > 0">
  <ng-container *ngIf="uploadPercentage; then loadBlock; else successLoadBlock"></ng-container>
  <button mat-button class="btn" [disabled]="checkedColumns.size < 1 || task" (click)="uploadFile()">
    {{ 'UPLOADER.SEND_FILE' | translate }}
  </button>
</div> 
或者,如果我只是删除了
ng容器
部分,一切正常。
但我需要把按钮放在容器里,所以我被卡住了。有人能帮忙吗?

你能做一个stackblitz演示吗?@Elmehdi不幸的是,没有,因为有很多逻辑,所以在该组件的样式中将mat按钮z-index移动到最大值,或者将其放在根SAAS中
<button mat-button class="btn" [disabled]="checkedColumns.size < 1 || task" (click)="uploadFile()">
    {{ 'UPLOADER.SEND_FILE' | translate }}
</button>
<div class="tile panel-container preview" *ngIf="dataSource?.length > 0">
    <ng-container *ngIf="uploadPercentage; then loadBlock; else successLoadBlock"></ng-container>
</div>