Typically if you need to perform any JavaScirpt operations before the Angular app kicks in this can be a bit of a pain. The solution is too boot the app manually. Instead of using ng-app in the parent template, this can be removed and called from a script instead. A common example where this would be useful is when you need to wait for dependent data to become available. The example below waits for user data to load from Firebase before initialising the app.