I use Angular 4. I have a directive which is a button, inserted into the parent's template like this:
<button (emitPdfUrl)="getInvoicePdfUrl($event);" pdfButton [pdfEl]="pdf">
<fa name="file-pdf-o"></fa> Download PDF
</button>
How can I run the method getPdf()
from the directive when the parent has fully rendered? I need this because this function will then get the innerHtml from some other parts of her parent's template. What happens right now is, the directive's function (getPdf()
) gets the half displayed template, ie. the template without the loaded variables of the parent, and thus, the innerHTML is not complete with loaded data inside, so the function takes the "empty" template. Thanks for any advice guys! :)