我有ASP.NET Durandal應用程序。Durandal和部分視圖
我需要做這將是多次使用一個局部視圖,I`ve作了嘗試這樣做:
define(function() {
return {
comments: [],
$.ajax({
url: '#/comments/index/' + id,
success: function(data) {
that.comments = data;
}
});
}
};
});
此代碼是另一viwemodel它調用/的ViewModels /評論/指數,並傳遞參數內,但是這個評論/索引返回完整的HTML(使用佈局)。
這是評論路線configugration
{ route: 'comments/index/:id', moduleId: 'viewmodels/comments/index', nav: false}
我怎樣才能獲得評論的HTML沒有佈局? 這是部分視圖的好方法嗎?
謝謝你,謝謝。我節省了很多時間。 :)(Y) –