我在路由器上获得userID
并传递给View。
路由器数据传输代码:
AdminPanelView.usr = m_login.toJSON().userID;
console.log(AdminPanelView.usr); //print user id
AdminPanelView.js
var usr = new UserModel();
var addAdminPanelView = Backbone.View.extend({
save: function(usr) {
console.log({ usr: usr.toJSON() }); // print the screenshot's value on line 52
}
});
return {
addAdminPanelView: addAdminPanelView,
usr: usr
}
我该如何解决这个问题?