When I run the code below I get the:
{{each(index,friend)friends}}
'<'li>${name}'<'/li>
{{/each}}
printed on the screen instead of the array elements I don't know if this has anything to do with HTML5. Also I added the jquery,konckout references and checked the syntax.
'<'h1>Friends'<'/h1>
'<'div data-bind="template: 'friendsTemplate'">'<'/div>
'<'script id="friendsTemplate" type="text/html"'>'
'<'ul>
{{each(index,friend)friends}}
'<'li>${name}'<'/li>
{{/each}}
'<'/ul>
'<'script type="text/javascript"'>'
function friend(name) {
return { name: ko.observable(name) };
}
var viewModel = {
friends: ko.observableArray([new friend("Ram"), new friend("Sam")]),
addFriend: function () {
this.friends.push(new friend("Another Guy"));
}
};
ko.applyBindings(viewModel);
/////////