apply ko.abservable(false) not working knockout
how can i apply ko.observable on Section three?
self.sections = ko.observableArray([
new Section('one', self.selectedSection),
new Section('two', self.selectedSection),
new Section('three', self.selectedSection)
]);
<h3>
<span>Selected: </span>
<span data-bind="text: selectedSection().name" />
</h3>
<div class="tabbable">
<ul class="nav nav-tabs" data-bind="foreach: sections">
<li data-bind="css: { active: isSelected }">
<a href="#" data-bind="click: $parent.selectedSection">
<span data-bind="text: name" />
</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active" data-bind="template: { name:
getTemplate }"></div>
</div>
</div>
http://jsfiddle.net/rniemeyer/wbtvM/
No comments:
Post a Comment