Reuse existent pieces of code tested and done properly
what is a service?!
Reuse existent pieces of code tested and done properly
Reuse existent pieces of code tested and done properly
Reuse existent pieces of code tested and done properly
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
};});
//factory style, more involved but more sophisticated
myApp.factory('helloWorldFromFactory', function() {
return {
sayHello: function() {
return "Hello, World!"
}};});
function $http(requestConfig) { var config = { method: 'get', transformRequest: defaults.transformRequest, transformResponse: defaults.transformResponse }; var headers = mergeHeaders(requestConfig); extend(config, requestConfig);
...
...