0

在此处输入图像描述在此处输入图像描述我确实有一个模态弹出窗口,其中在模态正文选项卡中。当我调用模式弹出但未应用活动选项卡颜色时。我使用 angular 2 将模态 ngx-bootstrap 用于模态弹出窗口和材质选项卡模块。任何帮助都会很棒。

材料成分链接

    <button md-button (click)="showLibrary()" class="upload-img-button"></button>
<!-- Image Library Popup -->
<div class="modal fade" bsModal #imageLibrary="bs-modal" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel"
    aria-hidden="true">
    <div class="modal-dialog image-lib-popup">
        <div class="modal-content">
            <div class="modal-body img-library">
                <button type="button" mdButton (click)="imageLibrary.hide()" class="close">
                  <md-icon class="material-icons">close</md-icon>
                </button>
                <md-tab-group class="tabs" [selectedIndex]="selectedTabIndex" >
                    <md-tab label="IMAGE LIBRARY">
                        <div [hidden]="options.imageType ==='images'">
                            <label class="title">Logos</label>
                            <div class="logo-section">
                                <ngx-gallery [options]="galleryOptions" [images]="galleryImages" (change)="getSelectedLogo($event)"></ngx-gallery>
                                <div class="">
                                    <image-upload class="" (onUpload)="onUploadDone($event,'logo')" [uploadOptions]="uploadOptions" [cropOptions]="{imageType:'logo'}"> </image-upload>
                                </div>
                            </div>
                        </div>
                        <div class="image-gallery" [hidden]="options.imageType ==='logo'">
                            <!--<label class="title">Images</label>-->
                            <ul class="logos">
                                <li class="" *ngFor="let image of imagesList;let i = index" (click)="imageSelected(i);selectedItem = i" [attr.data-index]="i"
                                    [ngClass]="{ 'img-media-container' : selectedImageItem === i }">
                                    <img src={{image}}/>
                                </li>
                            </ul>
                        </div>
                        <div class="d-flex justify-content-end abs-button">
                            <button md-button class="button blue-btn " (click)="setSelectedImages()" [disabled]="chooseFromLibrary">Continue</button>
                        </div>
                    </md-tab>
                    <md-tab label="UPLOAD IMAGES">
                        <label class="title"></label>
                        <image-upload class="" (onUpload)="onUploadDone($event,'images')"  [uploadOptions]="uploadOptions" [cropOptions]="{imageType:'image'}"> </image-upload>
                    </md-tab>
                </md-tab-group>
            </div>
        </div>
    </div>
</div>
4

1 回答 1

0

比较你的 setter: selectedItem = i 和你的 getter: selectedImageItem === i

于 2017-10-04T12:12:54.843 回答