I've angular module defined in a routine after window.onload, I believe the angular looks for the module before window is loaded but I need to ensure all my assets are loaded before I trigger the angular module.
Is there a way, maybe another load event like DOM ready etc. that I can hook my application startup and then angular startup? My angular module is a dependent and getting used by another library.
window.onload = function() {
angular.module("nav", [])
.controller("NavController", function() {
});
}
<nav class="state_2" ng-app="nav">
<ul ng-controller="NavController">
<li></li>
<li></li>
<li></li>
</ul>
</nav>
The you want to achieve is just by doing lazy loading app, using
angular.bootstrap
then you should removeng-app
from html.Markup
Code
Demo Plunkr