Skip to content

Instantly share code, notes, and snippets.

@mcabreradev
Created June 21, 2016 20:50
Show Gist options
  • Save mcabreradev/40a3a5eedac911d84ac8be0c0ffe7c21 to your computer and use it in GitHub Desktop.
Save mcabreradev/40a3a5eedac911d84ac8be0c0ffe7c21 to your computer and use it in GitHub Desktop.
/**
* App
* =============
*
* */
angular
.module('app.service')
.factory('RestangularCache', ['Restangular', '$cacheFactory', function(Restangular, $cacheFactory) {
return Restangular.withConfig(function(RestangularConfigurer) {
RestangularConfigurer.setDefaultHttpFields({cache: true});
});
}]);
/**
* PropertyService Service
* =============
* @ngdoc service
* @name main.
* @description Se utiliza para crear metodos que solo se utilizaran en una app principal
*
* */
angular
.module('app.service')
.service('Property', ['$http', '_', function ($http, _) {
var property = {};
this.set = function (name, value) {
return property.name = value;
};
this.get = function (name) {
return property.name;
};
this.getAll = function (name) {
return property;
};
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment