Skip to content

Instantly share code, notes, and snippets.

@eob
Last active December 17, 2015 23:19
Show Gist options
  • Save eob/5688792 to your computer and use it in GitHub Desktop.
Save eob/5688792 to your computer and use it in GitHub Desktop.
# In resource-controller.js
ResourceController = function(provider) {
this.a = 1;
};
ResourceController.prototype.printA = function(req, res) {
res.send(typeof this.a);
};
# In app.js
var rc = new ResourceController();
app.get('/a', rc.printA);
# Result
When I visit /a I get 'undefined'!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment