監視可能な this.isFollowing が変更されたときに、計算された関数 this.followButtonText が更新されず、常に (Follow) が表示されるのはなぜですか? $(document).ready(function () {
function AppViewModel() {
this.toggleIsFollowing = function () {
this.isFollowing = !this.isFollowing;
follow();
};
this.isFollowing = ko.observable(false);
this.followButtonText = ko.computed(function () {
return this.isFollowing ? "Unfollow" : "Follow";
});
}
ko.applyBindings(new AppViewModel());
}
});
</script>