这是项目结构:
/
app.js
package.json
/node_modules
/app
config.json
/frontend
assets and html tpls
/modules
couch.js
raeume.js
users.js
Run Code Online (Sandbox Code Playgroud)
我需要来自app.js的config.json,raeume.js和users.js,一切正常.
var config = require('./app/config');
var raeume = require('./app/modules/raeume');
var users = require('./app/modules/users');
Run Code Online (Sandbox Code Playgroud)
然后我要求user.js中的config.json和couch.js以同样的方式,它将找不到任何东西.
var couch = require('./app/modules/couch');
var config = require('./app/config');
Run Code Online (Sandbox Code Playgroud)
我想它应该找到它.经过一些研究,我看到了各种各样的问题,包括如何编译节点.因此包括:我使用节点v0.10.7在osx 10.8上工作.
而现在,对于完全不同的东西.
当"dom"对象是raphäel对象时,如何在骨干视图中委托事件.这有用吗?像这样:
var NodeView = Backbone.View.extend({
events: {
"click": "click"
},
click: function(){
alert('clicked')
},
render: function(){
canvas.rect(this.model.get('xPos'), this.model.get('yPos'), 50, 50).attr({
fill: "#EEEEEE",
stroke: "none",
cursor: "move"
});
return this;
}
});
Run Code Online (Sandbox Code Playgroud)
我需要在raphäel对象改变位置时更新模型.当我将事件直接附加到raphäel对象时,我只能访问该视图而不是整个视图,因此不能访问模型.
如何从backbone.js中的模型访问视图.
我很想在model.change()上重新渲染视图.
我对GAE Python的用户api有疑问.
对于已有用户群的新应用程序,我想为用户获取两个信息.首先是名称,第二个是标志(示例中为0,1或2).
这是一个内部应用程序,只有来自同一域的人才能登录.如何在用户参考中访问他们的信息?我怎么能设置额外的标志?
非常感谢.