I have written the following service in angularjs, how/what do I do to change it into a factory? And also, what are the advantages/differences when a factory is used instead of a service?
angular.module('helloApp').service('popupService', function() {
var popup;
var setter = function(parameter) {
popup = parameter;
};
var getter = function() {
return popup;
};
return {
setter: setter,
getter: getter
};
});
Thanks in advance