I use knockout in MVC c# project. I have shopping cart button on my web page and use below code to load shopping cart as modal dialog. This code works for first time but when I click again on shopping card it's not work. I know this problem is related to ko.applyBindings(new CartViewModel()); but I don't how to resolve it,
Any solutions and ideas are welcome.
$("#ShoppingCartButton").on("click", function () {
$("#ShoppingCartDialog").load("/Order/ShoppingCart", function () {
ko.applyBindings(new CartViewModel());
$("#ShoppingCartDialog").modal('show');
});
});