Knockout.js
Hands on introduction
Who am I?
Why a “Who am I?”
• Aymeric Gaurat-Apelli
• .NET developer/consultant since beta
• Worked in France, Australia (Readify) and Thailand
• Web entrepreneur
• Facebook games (1M users/day)
• http://taskarmy.com
• http://weekplan.net (knockout.js SPA)
• Employee at Jetabroad (Thailand)
What is Knockout.js?
• Javascript MVVM library
• Declarative data binding
• Templating
• http://knockoutjs.com
MVV What?
Model
View
Model
View
Knockout.js
love
Javascript
object
Portion
of HTML
Javascript
object
Server
side
Basics
ko.applyBindings(viewModel, domElement);
Hey Knockout.js
Apply my view model here
HTML Page
No problem!
Basics
ko.applyBindings(myViewModel, domElement);
Hey Knockout.js
Apply my view model here
HTML Page
No problem!
Observables
Can have subscribers
Raise an event when the value changes
You can have observable arrays too
<input type=“text” data-bind=“value: personName” />
Two way binding
Enough bla bla.
Let’s code…

Knockout (support slides for presentation)