This is the HTML I'm trying to bind to. I would like to know how to bind the result of menuInnerHtml to the navigationMenu div. Right now the output is: [object Object][object Object][object Object][object Object][object Object][object Object] instead of the actual html.
<div id="navigationMenu" data-bind="html: get_Menu()"></div>
var menuInnerHtml = $();
var GlobalNavMenuViewModel = {
get_Menu : function () {
for (var i = 0; i < 10; i++) {
if(i % 2 == 0 )
{
menuInnerHtml += $("<li></li>").attr('class', 'L1').html("someInfo");
}
}
return menuInnerHtml;
}
}
// Bind Html
ko.applyBindings(GlobalNavMenuViewModel);