Skip to content

Instantly share code, notes, and snippets.

@DomenicoColandrea86
Forked from davemo/bootstrap.js
Created April 29, 2014 20:56
Show Gist options
  • Save DomenicoColandrea86/749c93869d001c912853 to your computer and use it in GitHub Desktop.
Save DomenicoColandrea86/749c93869d001c912853 to your computer and use it in GitHub Desktop.
(function() {
var $injector = angular.injector(['ng']);
$injector.invoke(function($http, $rootScope) {
// this works!
$rootScope.$apply(function() {
$http.get("/auth/csrf_token").then(function(response) {
angular.module("app").constant("CSRF_TOKEN", response.csrf_token);
angular.bootstrap(document, ['app']);
});
});
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment