Я использую ng-bootstrap Здесь попробуйте сделать модальный пример, но когда я нажимаю на открытое модальное окно, оно не появляется, хотя оно существует внутри DOM.
моя основная версия angular: 4.0.0, @ng-bootstrap/ng-bootstrap: 1.0.0-alpha.29, bootstrap: 3.3.7
test-modal.component.html
<div class="modal-header">
<h4 class="modal-title">Hi there!</h4>
<button type="button" class="close" aria-label="Close" (click)="activeModal.dismiss('Cross click')">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p>Hello, {{name}}!</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" (click)="activeModal.close('Close click')">Close</button>
</div>
test-modal.component.ts
import {Component,Input} from '@angular/core';
import {NgbModal,NgbActiveModal} from '@ng-bootstrap/ng-bootstrap';
@Component({
selector: 'app-test-modal',
templateUrl: './test-modal.component.html',
styleUrls: ['./test-modal.component.css']
})
export class TestModalComponent {
@Input() name;
constructor(public activeModal: NgbActiveModal) {}
}
открытая функция в app.component.ts с конструктором
constructor(private modalService: NgbModal) {}
open() {
const modalRef = this.modalService.open(TestModalComponent);
}
кнопка внутри app.component.html
<button class="btn btn-lg btn-outline-primary" (click)="open()">Launch demo modal</button>
.angular-cli.json
в разделе стилей. - person abdoutelb   schedule 27.07.2017