1
我想在我的應用程序中用MVC流構造我的代碼。我試圖表現出如下我marionette.controller內我的提線木偶的應用程序實例創建佈局..顯示在Marionette.Application內部控制器中的佈局
- 誰能告訴我是不是顯示或控制器內改變佈局一個正確的方法是正確的方式或不?如果沒有,那麼有什麼適當的方法。
我的控制器
define([ 'marionette', 'app', 'index_view' ], function(Marionette, App, IndexView) {
console.log("Inside...ViewFlow Controller.");
var ViewFlow_Controller = Marionette.Controller.extend({
loadIndex : function() {
console.log("Inside...Load Index Method.");
App.main.show(new IndexView());
}
});
return new ViewFlow_Controller();
});
在我的IndexView是這樣
define(['app', 'helper', 'templates'],
function (App, Helper, templates){
console.log("Inside...Index View.");
App.Page_Index = (function(){
var Page_Index = {};
var _pageName = 'IndexPage';
var _pageLayout = Helper.newPageLayout({
name:_pageName,
panelView: Helper.newPanelView(),
headerView: Helper.newHeaderView({name:_pageName, title:'Welcome to the Index Page'}),
contentView: Helper.newContentView({name:_pageName, template: templates.content_index}),
footerView: Helper.newFooterView({name:_pageName, title:'IndexPage Footer'})
});
return Page_Index;
})();
return App.Page_Index;
});
我的助手返回我App_Layout實例。 但它不工作,它給我一個錯誤
Uncaught TypeError:object is not a function viewflow_controller.js:12
請幫助我。
如果您想參考完整的代碼或貢獻,可以找到代碼here。
在此先感謝。
感謝您的回覆......我很抱歉Github上的代碼..現在我已經提交了我的文件..請看看..我已經完成了上面所述的事情。請幫我解決這個問題。 – Rachna
已解決的問題與小的更改。 – Rachna