Skip to content

Instantly share code, notes, and snippets.

@charlietfl
Forked from davemo/bootstrap.js
Last active August 29, 2015 14:13
Show Gist options
  • Save charlietfl/ed41df4f4b579a47147a to your computer and use it in GitHub Desktop.
Save charlietfl/ed41df4f4b579a47147a 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