ng-modal

Angular7 and NgbModal: how to remove default auto focus

人走茶凉 提交于 2019-12-12 11:13:49
问题 we just upgraded our application to angular 7 and we noticed that all ngBootstrap modals have now a default autofocus on the close button like the following picture. here is my code: html modal code: <form [formGroup]="storeForm" novalidate> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title">Modal Test</h4> <button type="button" class="close" aria-label="Close" (click)="activeModal.dismiss('Cross click')"> <span aria-hidden="true">×</span> </button> </div> <div

Angular 2: NgbModal transclude in view

大城市里の小女人 提交于 2019-12-08 18:51:16
问题 Let's say i have such modal template: <div class="modal-header"> <h3 [innerHtml]="header"></h3> </div> <div class="modal-body"> <ng-content></ng-content> </div> <div class="modal-footer"> </div> and i'm calling this modal from another component so: const modalRef = this.modalService.open(MobileDropdownModalComponent, { keyboard: false, backdrop: 'static' }); modalRef.componentInstance.header = this.text; How can i put into NgbModal html with bindings etc? Into ng-content 回答1: You can get a