Created
February 26, 2016 18:23
-
-
Save AFelipeTrujillo/9e357e1851da64dd56a2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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