Did you know that the $http service can be utilized in two distinct ways?
Firstly, as a function, by using
var promise = $http(config);
. Here, the config object contains details about the http method and url.
Alternatively,
as an object, using
$http.get(url,config)
While I am aware that functions in JavaScript are essentially objects, I am uncertain about how to create an object that can act as a function call. Is this something I can achieve solely using JavaScript or is it specific to Angular?