Knockout.js with ASP.NET MVC and Razor

Can someone explain to me why I should use Knockout.js with ASP.NET MVC? While doing some research, it seems that the main use of knockout.js is for data binding. But why should I use knockout.js when I can bind elements with strongly typed views and use Razor?

Instead of the knockout method:

<td data-bind="text: Id"></td>

Can't I do it with Razor?

<td>@Model.Id</td>

I see that knockout is now included in MVC 4, but not sure how I can use it.

Sorry if this was asked before, but I did some searching in SO, but I could not find anything that would be clear to me.

+4
source share
1 answer

, MVVM js, knockoutjs, , , MVC, , HTML. javascript. AJAX- REST , . JSON, .

, Razor, . , , .

+11
source

Source: https://habr.com/ru/post/1527132/


All Articles