Here is code for your html part
this is for your ViewModel which you can use . The noticeable part here is i have used observable instead of using just plain JavaScript strings . so now when any changes made to those properties , changes will also refelect in your model .
First name:
Last name:
this is for your ViewModel which you can use . The noticeable part here is i have used observable instead of using just plain JavaScript strings . so now when any changes made to those properties , changes will also refelect in your model .
function AppViewModel() {Here is output window screen and link of js fiddle
this.firstName = ko.observable("Rahul");
this.lastName = ko.observable("Sharma");
}
// Activates knockout.js
ko.applyBindings(new AppViewModel());
No comments:
Post a Comment