Do Something And Continue Class Execution-Collection of common programming errors
Make a service instead of doing anything local. This way you can reuse it much easier across your application.
module.factory('$myHttp', ['$http', function($http) {
//do your stuff
return $http;
}]);
And then inside your controllers, directives or any other services, just include it as a dependency and use it like so:
$myHttp.get()
Here’s some more info about that:
http://www.yearofmoo.com/2012/10/more-angularjs-magic-to-supercharge-your-webapp.html#you-should-be-using-custom-services