JQuery's $(document).ready()
runs when the HTML has loaded and the DOM can be safely manipulated. When there's an Angular component on our page, can we count on everything in its template being there by that time? Even inside of ng-if
s? Even nested components?
I know that there's an OnInit
interface that components can implement, but that won't work in this case; the coder won't have access to any component code. I'm shipping a Web application in which we send out minified, bundled versions of our code but give customers guidance on adding their own customizations to pages inside of <script>
tags in the HTML. In giving them advice, are there any assumptions I can make, or will solutions inevitably end up with a bunch of timeouts and retrying when accessing DOM elements?
(Better yet - is there an event they could hook into from JS scripts outside of the component?)