KnockoutJS
Key features
• Declarative bindings
• Automatic UI refresh
• Dependency tracking
• Templating
• Free
• Pure JavaScript with no dependencies
• Small (54 kb minified)
• Fully documented
In 2 words
• Provides easy way to link data model
and UI by exposing MVVM pattern
MVVM
• Model-View-ViewModel
• It’s a pattern
• It’s all about separation of concerns
• In our case:
– Model – represents the data
– View – HTML presentation layer
– ViewModel – Holds the behavior and
data for the view
How modelis linkedto the UI and vice versa?
• 2 way data binding
What is2 way databinding?
• It’s a kind of magic
• It’s real fun
• It’s automatic way of synchronization
of data between model and view
One way data binding
Twoway databinding
Let’s takea lookat example
http://jsfiddle.net/Lo1xecse/
How 2 way data binding isachieved?
• Observables – are special JS
objects that can notify of changes
and can detect dependencies
What observablesareprovided?
• Observable
• Computed
• ObservableArray
Observableexample
http://jsfiddle.net/Lo1xecse/1/
Computedexample
http://jsfiddle.net/Lo1xecse/2/
http://jsfiddle.net/Lo1xecse/3/
Observablearrays
http://jsfiddle.net/Lo1xecse/4/
Controlflow bindings
• foreach – iterates through collection
• if
• ifnot
• with – changes context
Bindingcontext
• $root – root VM
• $parent – parent VM
• $data – current VM
• $index – current index in foreach
Interactivebindings
• click – calls VM method when model is
clicked
• value – form element value
• enable – enabling disabling element
• event – calls specified event when
occurs
• And many others…
Templates
• By default inline
http://jsfiddle.net/Lo1xecse/4/
• But still can be injected
http://jsfiddle.net/Lo1xecse/5/
Custombindings
• Allows to create your own bindings
and link them to elements
• Add to ko.bindingHandlers your own
object and use it in markup
• http://jsfiddle.net/Lo1xecse/6/
DevelopingSPA
• Perfectly suits for small or medium
level applications
• Does not have routing so it needs to
be added by yourself (sammy)
• Does not have ability to load
dynamically templates (can be easily
implemented)
Pros
• Free
• Lightweight
• Data binding is awesome
• Very small learning curve
• Perfectly suits for small to medium
level SPA
What’s next?
Let’s create sample application.
User management page (CRUD)
With JQuery, RequireJS, Knockout
Homework
• Pass knockout tutorial
• Implement users app with
knockout
Knockout js

More Related Content

PPTX
Debugging Microservices - key challenges and techniques - Microservices Odesa...
PPTX
microXchg 2018: "What is a Service Mesh? Do I Need One When Developing 'Cloud...
PPT
The eBay Architecture: Striking a Balance between Site Stability, Feature Ve...
PPTX
It summit 150604 cb_wcl_ld_kmh_v6_to_publish
PDF
Building data-driven microservices
PDF
Microservices Practitioner Summit Jan '15 - Microservice Ecosystems At Scale ...
PDF
Microservices Architecture
PPTX
Multi Team Architecture
Debugging Microservices - key challenges and techniques - Microservices Odesa...
microXchg 2018: "What is a Service Mesh? Do I Need One When Developing 'Cloud...
The eBay Architecture: Striking a Balance between Site Stability, Feature Ve...
It summit 150604 cb_wcl_ld_kmh_v6_to_publish
Building data-driven microservices
Microservices Practitioner Summit Jan '15 - Microservice Ecosystems At Scale ...
Microservices Architecture
Multi Team Architecture

What's hot (20)

PDF
SOA: What It Means To The Enterprise
PPTX
Alfresco DevCon 2019 Performance Tools of the Trade
PPTX
Micro Services Architecture
PPTX
Develop in ludicrous mode with azure serverless
PDF
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...
PDF
[WSO2Con EU 2017] Creating Composite Services Using Ballerina
PDF
TS 4839 - Enterprise Integration Patterns in Practice
PPTX
Introduction to microservices
PPTX
What are Software Defined Application Services
PPTX
Microservices and the future on Infrastructure
PDF
Mashups For Soa
PPTX
Voxxed Athens 2018 - Eventing, Serverless, and the Extensible Enterprise
PPTX
Pros & Cons of Microservices Architecture
PDF
Harvard it summit 2016 - opencast in the cloud at harvard dce- live and on-d...
PDF
[WSO2Con EU 2017] Microservice Architecture (MSA) and Integration Microservices
PDF
Scala Security: Eliminate 200+ Code-Level Threats With Fortify SCA For Scala
PPTX
Microservices and the Cloud based future of integration final
PPTX
Microservices Architecture - Bangkok 2018
PDF
Microservices Journey NYC
PPTX
A microservices journey - Round 2
SOA: What It Means To The Enterprise
Alfresco DevCon 2019 Performance Tools of the Trade
Micro Services Architecture
Develop in ludicrous mode with azure serverless
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...
[WSO2Con EU 2017] Creating Composite Services Using Ballerina
TS 4839 - Enterprise Integration Patterns in Practice
Introduction to microservices
What are Software Defined Application Services
Microservices and the future on Infrastructure
Mashups For Soa
Voxxed Athens 2018 - Eventing, Serverless, and the Extensible Enterprise
Pros & Cons of Microservices Architecture
Harvard it summit 2016 - opencast in the cloud at harvard dce- live and on-d...
[WSO2Con EU 2017] Microservice Architecture (MSA) and Integration Microservices
Scala Security: Eliminate 200+ Code-Level Threats With Fortify SCA For Scala
Microservices and the Cloud based future of integration final
Microservices Architecture - Bangkok 2018
Microservices Journey NYC
A microservices journey - Round 2
Ad

Viewers also liked (20)

PPTX
Knockout js
PDF
An introduction to KnockoutJS
PDF
Knockout js (Dennis Haney)
PDF
Knockout Introduction
PPT
Rabbit MQ introduction
PDF
Nicolas-Embleton - Deploying node.js with forever and nginx
PDF
Khanh-Nguyen - Gearman - distributed process solution
PPT
Knockout.js
PPTX
Knockout js
PPTX
Knockout (support slides for presentation)
ODP
Ejercicio final unidad 2
PPTX
Knockout js
PPTX
(Fast) Introduction to HTML & CSS
PPTX
Introduction to HTML
PPTX
Knockout JS Development - a Quick Understanding
PPT
Introduction to Javascript
PPTX
Html introduction by ikram niaz
PPTX
PPTX
Knockout
PPT
01. session 01 introduction to html
Knockout js
An introduction to KnockoutJS
Knockout js (Dennis Haney)
Knockout Introduction
Rabbit MQ introduction
Nicolas-Embleton - Deploying node.js with forever and nginx
Khanh-Nguyen - Gearman - distributed process solution
Knockout.js
Knockout js
Knockout (support slides for presentation)
Ejercicio final unidad 2
Knockout js
(Fast) Introduction to HTML & CSS
Introduction to HTML
Knockout JS Development - a Quick Understanding
Introduction to Javascript
Html introduction by ikram niaz
Knockout
01. session 01 introduction to html
Ad

Similar to Knockout js (20)

PPTX
Knockout implementing mvvm in java script with knockout
PPTX
Fundaments of Knockout js
PDF
Knockout js session
PPTX
Bringing the light to the client with KnockoutJS
PPTX
Knockout js
PDF
Knockout in action
PPT
KnockoutJS and MVVM
PDF
Knockoutjs
PPTX
Knock out Introduction with samples (jsfiddle.net)
PPTX
Building databound JavaScript apps with Knockoutjs
PDF
Knockoutjs databinding
PPTX
KnockOutjs from Scratch
PPTX
Knockout.js
PDF
Knockout mvvm-m1-slides
ODP
Introduction to Knockout Js
PPTX
MVVM Magic in SharePoint 2010 using Knockoutjs!
KEY
Sugarcoating your frontend one ViewModel at a time
PPTX
Knockout.js & SignalR
PDF
Intro to Knockout
KEY
KnockOutJS with ASP.NET MVC
Knockout implementing mvvm in java script with knockout
Fundaments of Knockout js
Knockout js session
Bringing the light to the client with KnockoutJS
Knockout js
Knockout in action
KnockoutJS and MVVM
Knockoutjs
Knock out Introduction with samples (jsfiddle.net)
Building databound JavaScript apps with Knockoutjs
Knockoutjs databinding
KnockOutjs from Scratch
Knockout.js
Knockout mvvm-m1-slides
Introduction to Knockout Js
MVVM Magic in SharePoint 2010 using Knockoutjs!
Sugarcoating your frontend one ViewModel at a time
Knockout.js & SignalR
Intro to Knockout
KnockOutJS with ASP.NET MVC

Recently uploaded (20)

PPTX
Microsoft Excel 365/2024 Beginner's training
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Five Habits of High-Impact Board Members
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
OpenACC and Open Hackathons Monthly Highlights July 2025
PDF
Credit Without Borders: AI and Financial Inclusion in Bangladesh
PDF
STKI Israel Market Study 2025 version august
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PPTX
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
PDF
Getting started with AI Agents and Multi-Agent Systems
PPTX
Custom Battery Pack Design Considerations for Performance and Safety
PDF
UiPath Agentic Automation session 1: RPA to Agents
PDF
Convolutional neural network based encoder-decoder for efficient real-time ob...
PDF
Produktkatalog für HOBO Datenlogger, Wetterstationen, Sensoren, Software und ...
PDF
Consumable AI The What, Why & How for Small Teams.pdf
Microsoft Excel 365/2024 Beginner's training
sustainability-14-14877-v2.pddhzftheheeeee
Hindi spoken digit analysis for native and non-native speakers
Five Habits of High-Impact Board Members
Developing a website for English-speaking practice to English as a foreign la...
OpenACC and Open Hackathons Monthly Highlights July 2025
Credit Without Borders: AI and Financial Inclusion in Bangladesh
STKI Israel Market Study 2025 version august
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Enhancing emotion recognition model for a student engagement use case through...
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
Getting started with AI Agents and Multi-Agent Systems
Custom Battery Pack Design Considerations for Performance and Safety
UiPath Agentic Automation session 1: RPA to Agents
Convolutional neural network based encoder-decoder for efficient real-time ob...
Produktkatalog für HOBO Datenlogger, Wetterstationen, Sensoren, Software und ...
Consumable AI The What, Why & How for Small Teams.pdf

Knockout js