How can I use a function as an object? More precisely, I'd like to repeat the $http
behavior of the angle, where you can perform a requisition in the following ways:
$http.get('url');
$http.post('url', data);
$http({
method: 'get',
url: 'url',
...
});
Note that the $http
function can be either directly invoked or used as an object to get the properties get
and post
.