Created
January 15, 2015 02:41
-
-
Save Shiggiddie/82f7712970b039cf3ef2 to your computer and use it in GitHub Desktop.
beer_me learnings
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
After porting beer_me to a mean.js app, I kept seeing "exports": e.g. "exports.foo = function() {console.log('hi');}" | |
I assumed this had something to do with the way the functions were exposed elsewhere in a mean.js app's codebase. | |
This assumption was fairly correct, and confirmed after reading: http://www.sitepoint.com/understanding-module-exports-exports-node-js/ | |
I do not understand this line: https://github.com/cpww/beer_me/blob/master/app/controllers/users.server.controller.js#L11 | |
Where does the ".extend" method come from? | |
So the var "_" is assined the module.exports object from "lodash". | |
Therefore "_.extend" is accessing the "extend" function from within the "lodash" module. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment