Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- File 1:
- _ = require('underscore')._;
- Controller.prototype.loadInit = function( controller ){
- if(controller[1] in this.models){
- this.model = this.models[controller[1]];
- }
- var req = {
- sockets: this.sockets,
- controller: controller[1],
- utils: this.utils,
- library: this.library,
- app: this.app,
- config: this.config,
- db: this.db,
- models: this.models,
- model: this.model,
- _: _
- };
- controller[0].init(req);
- };
- File 2:
- module.exports = {
- init: function(req){
- console.log(_);
- }
- }
- //I want to use _ inside the init function without having to redefine underscore in file 2
Advertisement
Add Comment
Please, Sign In to add comment