在angular2項目中使用Bootstrap 4,在一個組件中的多個組件然而,我的模態出現在灰色淡入淡出(背景)下面,並且是不可編輯的。 Bootstrap 4模態出現的背景角2
firstComponent.html
<batopPage>
<button class="btn btn-success" (click)="lgModal.show()">Large modal</button>
<!-- Large modal -->
<div bsModal #lgModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button class="close" (click)="lgModal.hide()" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title">Large modal</h4>
</div>
<div class="modal-body">
suscipit lobortis nisl ut aliquip ex ea commodo consequat.
</div>
<div class="modal-footer">
<button class="btn btn-primary confirm-btn" (click)="lgModal.hide()">Save changes</button>
</div>
</div>
</div>
</div>
</batopPage>
firstComponent.ts
@Component({
selector: 'firstcomponent',
template: require('./firstComponent.html')
})
export class Modals {
@ViewChild('childModal') childModal: ModalDirective;
showChildModal(): void {
this.childModal.show();
}
hideChildModal(): void {
this.childModal.hide();
}
}
otherComponent.html
<firstcomponent></firstcomponent>
不確定任何人都可以在這裏沒有一個最小的笨蛋顯示你的確切代碼... –
我對angular2一無所知,但你總是可以參考http://nakupanda.github.io/bootstrap3-dialog/這裏。它將使您更容易管理給定鏈接的引導程序。無需由您自己管理它。 –