Last active
November 16, 2017 13:23
-
-
Save davemo/6141699 to your computer and use it in GitHub Desktop.
injectorsauce
This file contains hidden or 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() { | |
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']); | |
}); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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