我正在尝试在更改为 viewModel 后更新 UI,但它不起作用,我错过了什么吗? http://jsfiddle.net/rdZjb/1/
viewModel = {
firstName : ko.observable("adrian")
}
$("#button1").click(
function ()
{
viewModel.firstName = "Paul";
alert(viewModel.firstName);
}
)
ko.applyBindings(viewModel);