Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71528

Add lifecycle method to all components, or listen for connected/loaded

$
0
0

I would like to know when a component instance is first rendered on a page.

There seems to be a couple of ways of tackling this. Inject something in the build that adds a lifecycle method to all components (like componentDidLoad) or listen to a loaded event that is emitted from all components when they are first loaded.

I have seen whenDefined, but that only applies to the component first load rather than the instance.

Any ideas how to achieve this?

Edit: This also applies to components nested in shadow dom of other components

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 71528

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>