Jon Galloway - Technical Evangelist Christopher Harrison - Content Developer
Jon Galloway - Technical Evangelist Christopher Harrison - Content Developer
Content Developer
Focused on web and OSS
Microsoft Certified Trainer
Still misses his Commodore 64
Long time geek
Regular presenter at TechEd
Periodic blogger
Marathoner, husband, father of one four legged child
Meet Jon Galloway | @jongalloway
03 | Components
Setting Expectations
• Target Audience
– HTML/CSS developer
– New to Knockout
– Possibly XAML developer wanting to move to web
– Looking to fill knowledge gaps
• Suggested Prerequisites/Supporting Material
– Visual Studio 2015 Community
Join the MVA Community!
• What is Knockout?
• Obtaining Knockout
• Hello, Knockout
DEMO
What we’ll be building
What is Knockout?
What Knockout provides
• An MVVM library
• Automatic UI refresh and updates
• Reusable templates
• Can be used with nearly any framework
• Focused on data binding
• Small library size
What Knockout isn’t
• A full framework
Angular
Ember
Knockout
jQuery
What is MVVM?
• Model
– Domain model (or data access layer)
• View
– The display the user will see
• View model
– The data the user will see
– A “pure-code representation of the data and operations on a UI”
MVVM in pictures
Model
FirstName
View View Model
LastName
Name Name
Email
Email Email
LoadUser()
SaveUser()
MVVM in pictures
Person Model
FirstName
LastName
Load() / Save()
View View Model
Developer Developer
Bug Model
Description
Developer
Load() / Save()
Obtaining Knockout
DEMO
Getting Knockout with NuGet
DEMO
Getting Knockout with Bower
DEMO
Using Knockout from CDN
Hello, Knockout
Knockout concepts
• Observables
– Things we want to keep an eye on
– Values may change
• When they do, everyone that’s interested is alerted
• Arrays
– Collections of objects
– Can also be observable
• Computed observables
– Values that are the result of code execution
DEMO
Hello, Knockout
©2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics and other product names are or may be registered trademarks and/or trademarks in the
U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft
must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after
the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.