I know how to call a TypeScript when clicking a button, but how do you call a function without that type of event? I would like to call a function when I have an array called chartData populated. This is what I have:
<div *ngIf="chartData.length">
chartMethod();
</div>
But instead of chartMethod() being called, it just prints 'chartMethod()' on the html page.
I've also tried:
<script>
chartTest();
</script>
but the function was still not called.