Skip to content

Instantly share code, notes, and snippets.

@matiasfha
Created November 4, 2015 18:54
Show Gist options
  • Save matiasfha/24ef8a087e5e3c1651e0 to your computer and use it in GitHub Desktop.
Save matiasfha/24ef8a087e5e3c1651e0 to your computer and use it in GitHub Desktop.
Angular start method
(function(window, document, undefined) {
<!--
here goes entire AngularJS code
including functions, services, providers etc related code goes here
-->
if (window.angular.bootstrap) {
//AngularJS is already loaded, so we can return here...
console.log('WARNING: Tried to load angular more than once.');
return;
}
//try to bind to jquery now so that one can write angular.element().read()
//but we will rebind on bootstrap again.
bindJQuery();
publishExternalAPI(angular);
jqLite(document).ready(function() {
angularInit(document, bootstrap);
});
})(window, document);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment