Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dac09/041b636dc6e0bd659107 to your computer and use it in GitHub Desktop.
Save dac09/041b636dc6e0bd659107 to your computer and use it in GitHub Desktop.
injecting $http in the console Angular JS
var angularAppName = 'angularStore'; //replace this with your app name
var $inj = angular.injector([angularAppName]);
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