при открытии модального диалогового окна начальной загрузки модальное окно закрывается немедленно - оно отображается только при отладке. Смотрите мой код: Html открывалки:
<span>
<span>
<button type="button" (click)="openDialog()">
Open dialog
</button>
</span>
</span>
код компонента:
export class dialogOpener implements OnInit {
constructor(private modalService: NgbModal) { }
openDialog()
{
const modalRef : NgbModalRef = this.modalService.open(modalDialogComponent);
}
}
Модальное окно Html:
<p>modalDialog works!</p>
код компонента:
export class modalDialogComponent {
constructor(private activeModal: NgbActiveModal, private modalService: NgbModal) { }
}
app.module.ts:
@NgModule({
declarations: [
...
AppComponent,
modalDialogComponent,
],
imports: [
...
],
entryComponents:[modalDialogComponent],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Что здесь не так?