再会。有下一个问题。从路由器我请求查看,但我返回为“function (){ return parent.apply(this, arguments); }”而且我无法访问方法。
路由器.js:
// Filename: router.js
define([
'jquery',
'underscore',
'backbone',
'views/page/pageView'
], function($, _, Backbone, PageView){
var AppRouter = Backbone.Router.extend({
routes: {
"": "index",
"page": "page"
},
index: function() {
//console.log(PageView);
PageView;
},
page: function() {
alert("page");//welcomeViewInstance.render();
}
});
initialize = function(){
var appRouterInstance = new AppRouter();
Backbone.history.start();
};
return {
initialize: initialize
};
});
视图.js:
define([
'jquery',
'underscore',
'backbone',
'text!templates/page/page.html'
], function($, _, Backbone, pageTemplate){
var pageView = Backbone.View.extend({
test: "test"
});
return pageView;
});
我坚持了下来。我该如何管理它?