我使用了ngx-bootstrap模态.但是当我使用mat-select内部时,我遇到了问题.在模态后面的mat-select选项显示.我已经这些解决方案在这里的解决方案,并 同时这一个
这是我的代码
<ng-template style="border: 0px ;z-index: 100" #editTemplate>
<mat-form-field>
<mat-select multiple placeholder="Multiple Cities" [(ngModel)]="currentCity" name="Paris" ariaLabel="cities[0]">
<mat-option *ngFor="let city of cities" [value]="city.value">
{{ city.viewValue }}
</mat-option>
</mat-select>
</mat-form-field>
<ng-template>
Run Code Online (Sandbox Code Playgroud) material-design angular2-template angular-material2 angular2-modal angular
我正在显示 a mat-select
inside a ngx-smart-dialog
,当我打开它时,select
它显示在对话框后面。我用这个解决方案找到了这个和这个:
.cdk-global-overlay-wrapper, .cdk-overlay-container {
z-index: 9999!important;
}
Run Code Online (Sandbox Code Playgroud)
如果我将其放入全局文件中,问题就解决了.scss
。我想知道的是(因为在我读到的内容中我没有找到解释)为什么将它放在组件的视图(即模态组件的视图)中它不起作用。
提前致谢!
angular ×2