Skip to content

Instantly share code, notes, and snippets.

@AFelipeTrujillo
Created February 26, 2016 18:23
Show Gist options
  • Save AFelipeTrujillo/9e357e1851da64dd56a2 to your computer and use it in GitHub Desktop.
Save AFelipeTrujillo/9e357e1851da64dd56a2 to your computer and use it in GitHub Desktop.
app.factory('mathFactory',function(){
var factory = {};
factory.mod = function(a,b){
return a % b;
}
return factory;
});
app.service('calcService',function(mathFactory){
this.isEven = function(a){
return mathFactory.mod(a,2) === 0;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment