The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Using angular.bootstrap to Initialize Your App

Using angular.bootstrap to Initialize Your App

1:13
In this lesson, John shows you how to use `angular.bootstrap` as an alternative approach to initializing your application without using `ng-app`.
Watch this lesson now
Avatar
egghead.io

In this lesson, John shows you how to use angular.bootstrap as an alternative approach to initializing your application without using ng-app.

Avatar
Ben

Is there anyway to do this with ng-model?

In reply to egghead.io
Avatar
JItin

This (using angular.bootstrap) requires that the angularjs file be loaded at the end of the body and not in the head.
If you load it in the head, it doesn't work - I guess document.getElementById does not work as the body has not loaded yet.

But loading it after the body causes a small period of time where you see everything in curly braces.
The solution I found was this: wrapping up the angular.bootstrap call in the document.ready function like this:

angular.element(document).ready(function(){
angular.bootstrap(document.getElementById("container"), ["app"])
});

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?