Created
November 4, 2015 18:54
-
-
Save matiasfha/24ef8a087e5e3c1651e0 to your computer and use it in GitHub Desktop.
Angular start method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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