22
#comdaybe Creating rich, responsive display and editor user interfaces with Knockout.js

20120621 creating rich, responsive display and editor

  • Upload
    biwug

  • View
    1.189

  • Download
    4

Embed Size (px)

DESCRIPTION

community day

Citation preview

Page 1: 20120621 creating rich, responsive display and editor

#comdaybe

Creating rich, responsive display and editor user interfaces

with Knockout.js

Page 2: 20120621 creating rich, responsive display and editor

About me

• @tomvangaever• Microsoft Premier Field Engineer• Microsoft Extended Experts Team • MCT, MCITP, MCPD, MCTS• BIWUG

Page 3: 20120621 creating rich, responsive display and editor
Page 4: 20120621 creating rich, responsive display and editor
Page 5: 20120621 creating rich, responsive display and editor

What?Knockout.js

Page 6: 20120621 creating rich, responsive display and editor

Elevator pitch

• Open source JavaScript library (MIT license)

• Community Project• Clean underlying data model• MVVM design pattern

• Steve Sanderson• Microsoft Program Manager - ASP.NET

Page 7: 20120621 creating rich, responsive display and editor

Problem?

• Rich client-side interactivity• Bindings• Wide browser support

Page 8: 20120621 creating rich, responsive display and editor

Browser support

• Mozilla Firefox 2.0+ • Google Chrome • Microsoft Internet Explorer 6, 7, 8• Apple Safari• Opera 10 for Windows

Page 9: 20120621 creating rich, responsive display and editor

Browser support - Validation

• Simply download the source code• Open /spec/runner.html on the

browser.

• >300 behavioral specifications tested• A report of any problems

• Demo

Page 10: 20120621 creating rich, responsive display and editor

What?MODEL/VIEW/VIEWMODEL (MVVM)

Page 11: 20120621 creating rich, responsive display and editor
Page 12: 20120621 creating rich, responsive display and editor

Step By stepKnockoutjs

Page 13: 20120621 creating rich, responsive display and editor

Who is familiar with...

• HTML• JavaScript

Page 14: 20120621 creating rich, responsive display and editor

Check!

• HTML• JavaScript

• Very easy!

Page 15: 20120621 creating rich, responsive display and editor

How to use it?

HTML<script type="text/javascript" src="../js/knockout-latest.js“ /><input data-bind="value: userName" />

Page 16: 20120621 creating rich, responsive display and editor

How to use it?

HTML<script type="text/javascript" src="../js/knockout-latest.js“ /><input data-bind="value: userName" />

JavaScriptvar ViewModel = function (userName) { this.userName = ko.observable(userName); }ko.applyBindings(new ViewModel("Tom Van Gaever"));

Page 17: 20120621 creating rich, responsive display and editor

demoYes we can!

Page 18: 20120621 creating rich, responsive display and editor
Page 20: 20120621 creating rich, responsive display and editor

http://learn.knockoutjs.com/

Tutorial

Page 21: 20120621 creating rich, responsive display and editor

Q&A