Skip to content

Instantly share code, notes, and snippets.

@davemo
Last active November 16, 2017 13:23
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save davemo/6141699 to your computer and use it in GitHub Desktop.
Save davemo/6141699 to your computer and use it in GitHub Desktop.
injectorsauce
(function() {
var $injector = angular.injector(['ng']);
$injector.invoke(function($http) {
// this works!
$http.get("/auth/csrf_token").then(function(response) {
angular.module("app").constant("CSRF_TOKEN", response.csrf_token);
angular.bootstrap(document, ['app']);
});
});
})();
@devmark
Copy link

devmark commented Jul 17, 2015

Hello,

How this can make sure "my client" calling "/auth/csrf_token"?
I think client side should be load from server side which include csrf token when bootstraping interface

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment