Skip to content

Instantly share code, notes, and snippets.

@atefBB
Forked from davemo/bootstrap.js
Last active November 16, 2017 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atefBB/ef1ae5ea3ea395604d896b0ccdc063ae to your computer and use it in GitHub Desktop.
Save atefBB/ef1ae5ea3ea395604d896b0ccdc063ae to your computer and use it in GitHub Desktop.
injectorsauce
(function() {
/**
* Bootstrap ng-app.
*/
var $injector = angular.injector(['ng']);
$injector.invoke(function($http) {
$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