Recently, I developed a service called tableService using the following code:
app.factory('tableService', [function() {
var data = some data;
var foo = function (){
//do something to data here
};
return {
data: data,
foo: foo
}
}]);
Now, I am looking to create another service that mirrors the properties of tableService so that I can leverage its functionality with a different dataset.
Is there a way I can achieve this without duplicating the code for each service by doing something like:
app.factory('tableService', 'secondService', [function() {
}]);
This would help streamline the process and avoid repeating code unnecessarily. Any suggestions?