Skip to content

Instantly share code, notes, and snippets.

@davemo

davemo/bootstrap.js

Last active Nov 16, 2017
Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@devmark 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
You can’t perform that action at this time.