Search code examples
angularjsngcloakpym.js

Executing code at the end of angular initialization, and ngCloak display


I have a webpage written in angular with an ngCloak directive. It is loaded in a dynamically sized iframe with pym.js.

The trouble is that the page does not appear unless I resize the browser or trigger a resize event, or call pymChild.sendHeight() after the page loads.

I don't see any events associated with ngCloak though. Is there an angular event for "page is rendered, controllers are initialized"?


Solution

  • There is the $timeout service:

    $timeout(function() {
       // this code will execute after the render phase
    });