You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, it would be very helpful if the module 'propagates' the variables defined in it in the node.js environment.
Il'l explain better:
in your base example you wrote
var requireFrom = require('requirefrom')
var views = requireFrom('lib/components/framework/views/')
but it would be VERY helpful if 'views' would be visible in all the other node.js scripts (obiouvsly requiring "requirefrom"). What do you think?
The text was updated successfully, but these errors were encountered:
Perhaps you should instead consider Dependency Injection. This is when you write your modules as a function (or "factory") that encompasses the module's methods, and that factory accepts the dependencies (views in that example) as it's arguments.
'views' in your question is an object like any other that can be injected into your modules, or assigned to some application object that is passed to all your modules.
Hi, it would be very helpful if the module 'propagates' the variables defined in it in the node.js environment.
Il'l explain better:
in your base example you wrote
but it would be VERY helpful if 'views' would be visible in all the other node.js scripts (obiouvsly requiring "requirefrom"). What do you think?
The text was updated successfully, but these errors were encountered: