I want a method get called automatically when template get completely loaded. I have tried lifecycle hooks of ionic as well as angular and I have also tried to call method from template. html
My HTML file contains the following:
<h1>{{ myMethod() }}</h1>
But this is calling the myMethod function many times.
myMethoddo, and why is it not acceptable for this function to be called multiple times?myMethodloads the map? Shouldn't this then be called by the button's click event? You should assume bindings like this in the view will be called multiple times.ngAfterViewChecked? that's the last lifecycle hook which runs after components & all its children are fully rendered with DOM changes applied.