Knockout.js fundamentals

In this section, you will learn how to create a very simple "Hello World" application with step-by-step instructions. Each step will describe one of the main Knockout.js concepts.

Creating a View

Let's learn about Knockout.js with a very simple example. We start work with the following code of an HTML page (HelloWorld-Example1.html):

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Hello world on Knockout.js</title>
  </head>
<body>
<span>Hello World!</span>

<script type='text/javascript' src='knockout-3.1.0.js'></script>
</body>
</html>

If we open this page in our favorite web browser, we will see the blank page with a single line, Hello World!. The body of this HTML page is the View layer of our MVVM ...

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.