2016-12-30 56 views
0

我有以下的Node.js - 函数公开中的模块

g = function() { 
    require(["game"], function(b) { 
    ... 
    } 
} 

我怎么会去内game暴露一切的代码片段?如果有帮助,我正在使用RequireJS?

如果我做,如果我做window.b= b;并尝试访问b.functionWithin()我得到的错误functionWithin not a function

得益于该模块的出口

+1

http://stackoverflow.com/questions/15287537/calling-function-inside-a-function-in-requirejs-module-javascript – Nevertheless

回答

1

一切都被分配到b,在你的榜样。