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

20120621 creating rich, responsive display and editor

May 11, 2015

Download

Technology

BIWUG

community day
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
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