I created one ng-template with two text fields. I am trying to open this template popup when my screen loads. But when I pass my id its not working.
<ng-template #contentreset let-c="close" let-d="dismiss">
<div class="modal-header">
<p class="modal-title" style="color:black;font-weight: bold;font-size:14px;">Reset password</p>
<button type="button" class="close" aria-label="Close" (click)="d('Cross click')">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<
</div>
ngOnInit() {
this.modalService.open(contentreset,{ centered: true }); //here modalservice is NgbModal
});
I tried passing the value from other button click but it doesnt worked. How to pass the ng template id while the page loads
before using
ngTemplate
we need to create it's tempateRef in component, so try like thiscall this template in
ngAfterViewInit()
for more info have look here