Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


can't test Angular app initialized by angular.bootstrap(document) #422

dai-shi opened this Issue · 6 comments

4 participants


I have an app which is initialized by angular.bootstrap() as
described as Manual Initialization in

   angular.element(document).ready(function() {

How can I run the e2e test for the app?


The scenario runner needs to be able to find the root element, put ng-app on it, so you need to bootstrap document.body or something (because you can't put a css class on document):

document.body.className = document.body.className + ' ng-app';
@vojtajina vojtajina closed this

This works. Thanks.


but why? what is the difference putting ng-app in your static html?


Because I want to control the bootstrap timing from JavaScript.
Please visit:
Hopefully, you get the idea: First, the HTTP server returns a pre-rendered HTML page,
and based on a certain request (ex. user clicks, or timer), the angular bootstrap begins.




If it helps, I've created a preprocessor for Karma that will inject the ng-app fix mentioned by vojtajina.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.