Skip to content

Instantly share code, notes, and snippets.

@chrishokamp
Created December 11, 2013 00:24
Show Gist options
  • Save chrishokamp/7902972 to your computer and use it in GitHub Desktop.
Save chrishokamp/7902972 to your computer and use it in GitHub Desktop.
how to inject $http into the console for an Angular app
var $inj = angular.injector(['App']);
var serv = $inj.get('$http');
var x = serv({method: 'POST', url: 'http://127.0.0.1:5000'}).success(function(data){console.log(data)}).error(function(data, status, header){ console.log(data); console.log(status); console.log(header);});
console.log(x);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment