Appendix A. A Brief on Knockout MVC References and Features

In this appendix, you will find a quick overview of the main Knockout MVC features. Most of the features are shown in the form of source Razor syntax and generated HTML/JavaScript output. You can use this appendix like a handbook while developing Knockout MVC applications.

Working with KnockoutContext

The main object when forming a View is an instance of the KnockoutContext class. It is necessary to create it at the beginning of the view, using the following line:

var ko = Html.CreateKnockoutContext();

At the end of the view, it is necessary to apply the formed data binding. You can do it in the following way:

@ko.Apply(Model)

If you have a lot of data that needs some time to load, it makes ...

Get Getting Started with Knockout.js for .NET Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.