Examples
Knockout is a JavaScript library that makes it easier to create rich, desktop-like user interfaces with JavaScript and HTML. It works particularly well with the MVVM pattern, offering declarative bindings somewhat like Silverlight but without the browser plugin.
Introductory examples:
- Hello world (Demonstrates working with ko.observable and ko.dependentObservable)
- Click counter (Illustrates declarative bindings and how Knockout tracks dependencies automatically)
- Simple list (Demonstrates working with ko.observableArray)
- Better list (Demonstrates combining more behaviors)
- Control types (For reference, an example of binding to a range of HTML control types)
- Templating (Shows how to render templates, including nested ones)
- Paged grid (Shows how you can create reusable components, i.e., plugins)
- Animated transitions (Shows two simple ways to implement animated transitions, one of which is a custom binding)
More interesting examples:
- Contacts editor (Editing a nested list)
- Editable grid (Demonstrates the 'foreach' binding and integrating with jQuery Validation)
- Shopping cart screen (Includes nested dropdowns and a string formatting function)
- Twitter client (Combines templating, declarative bindings, and Ajax)
