Search, explore and find the perfect course for you
Using Knockout To Build Dynamic, Testable Web UIs
This course will teach you how to use Knockout effectively - but it doesn't stop there. It also teaches you what a view model is, what it should be responsible for, and how to factor it. And, perhaps most importantly, you will learn how to write tests for your view models.
Along with explanations of the patterns and techniques involved and many code walkthroughs, the course also has a series of practical labs, providing an opportunity for you to dig in to Knockout and try writing view model tests for yourself.
What you will learn
- The architecture of the web
- The rise of the Single Page Application
- The challenge of user experience
- The need for testability
- The role of design patterns, and how they help
The MVVM Presentation Pattern
- So what is a model, anyway?
- RESTful models
- View Models
- Data binding
- The observer pattern
- What is Knockout?
- Declarative data binding in HTML
- Creating simple view models with observables
- Binding the view model to the view
- Exercise: your first view model
Basic View Model Testing
- What is unit testing?
- Why write automated tests?
- Introduction to QUnit
- Writing basic view model unit tests
- Exercise: writing some basic view model tests
- What is a computed observable?
- How dependency tracking works
- Writing tests
- Writable computed observables
- Exercise: using a testing computed observables
Event Binding and Server Interaction
- Client side view model, server side model
- Event binding
- How to factor the server interaction for testability
- Implementing the call to the server
- Testing the interaction without really calling the server
- Exercise: event binding and server interaction
- What is an observable array?
- The foreach binding
- Populating with data from the server side - in a testable way
- Exercise: observable arrays and the foreach binding
Filling In Some Gaps: More Bindings and the Binding Context
- The if and ifnot bindings
- The with binding
- The css, style and attr bindings
- The hasFocus binding
- The uniqueName binding, and when you may need it
- The binding context, $root, $data, $parent, $index and $element
- Exercise: bindings and binding contexts
- The re-use problem templates tackle
- Basic template usage
- Rendering tree-like data using templates
- Dynamically selecting templates
- Integrating other template engines
- Exercise: templates
- What are custom bindings?
- Using a plug-in providing a custom binding
- Writing your own custom binding
- Exercise: custom bindings
Also Good To Know
- Augmenting observables with extenders
- The throttle extender
- The mapping plug-in
- Performance gotchas
- Where to find stuff: plug-ins, examples, documentation