我对棱角非常陌生。我有一个模态,它会弹出一个单击按钮的窗口,并且在其他几个地方都需要此模版(按钮和模态),为此我创建了一个单独的组件,但不幸的是,我遇到了上述错误。
modal.component
export class NotificationModalComponent {
msgRef: BsModalRef;
constructor(private modalService: BsModalService ) { }
getNotify(template?:TemplateRef<any>){
this.msgRef = this.modalService.show(template);
}
<button (click)="popsModal('msgmodal')">
<ng-template #msgmodal>
<div class="modal-body text-center">
<h3>Allow Notifications</h3>
<small>Click allow to get push notifications</small>
</div>
</ng-template>
otherParentComponet
<app-modal></app-modal>