I m new to Knowckout.js and have done this demo.
http://jsfiddle.net/Yawer/7QXCN/#&togetherjs=Aunph9nuxf
In this implementation dependentobervable is out side viewModel. My question is, is there a way fullname which is a dependentObservable can come inside viewModel just like name and other properties ?
Below is my code:
$(function(){
var viewModel={
name: ko.observable("Biala"),
changedName: function(){
this.name("Hussain");
},
nvtoggle: ko.observable(true)
};
viewModel.fullName= ko.dependentObservable(function(){
return this.name() + " is " + (this.nvtoggle() ? " " : " not ") + "visible";
},viewModel);
ko.applyBindings(viewModel);
});