Skip to content

Instantly share code, notes, and snippets.

@richardTowers
Created September 25, 2015 13:09
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 richardTowers/e9e59614301c97fb0a5f to your computer and use it in GitHub Desktop.
Save richardTowers/e9e59614301c97fb0a5f to your computer and use it in GitHub Desktop.
var injector = angular.injector(['ng']);
injector.instantiate(function ($http) {
window.$http = $http;
});
$http.get('https://whatever.com');
@richardTowers
Copy link
Author

Get's $http from the angular injector and exposes it globally.

Useful for debugging if you just want to play with $http in the console.

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