Inside b. js: define(["require", "a" function (require, a) { "a" in this case will be null if a also asked forb, a circular dependency. return function (title) { return require("a" ). doSomething();
模块也可以不必返回对象,任何有效的返回都是可以的,比如上面的例子,返回一个函数作为其模块定义。
Inside b. js: define(["require", "a" function (require, a) { "a" in this case will be null if a also asked forb, a circular dependency. return function (title) { return require("a" ). doSomething();
模块也可以不必返回对象,任何有效的返回都是可以的,比如上面的例子,返回一个函数作为其模块定义。
应用推荐