Knockout.js & SignalR

4,960 views

Published on

Published in: Technology

Knockout.js & SignalR

  1. 1. Knockout.js Dynamic Web UIs and the MVVM patternÆgir ÞorsteinssonLandsbankinn@thorsteinssonhttp://thorsteinsson.is/
  2. 2. Knockout.jsMVVM for HTML and JavaScript Open source JavaScript library (MIT license – source on GitHub) ~ 1 year old; active community Community project (not run by Microsoft)
  3. 3. Knockout.js What is it good for? Rich client-side interactivity Bye bye, overlapping mess of interrelated event handlers Hello, object-oriented JavaScript MVVM pattern and declarative bindings Wide browser support 6+ 2+http://knockoutjs.com
  4. 4. MVVM in JavaScript View HTML + declarative bindingsBrowser Automatic ViewModel JavaScript + observables Ajax / form postsServer “Model” Any server-side technology
  5. 5. Examples
  6. 6. Examples
  7. 7. Commonly-used bindings text html visible Content & appearance css attr style event click submit Events value options checked Form fieldsselectedOptions enable disable template Templating Control flow if with foreach (KO 1.3)
  8. 8. Knockout.jsHow is it different? Automatic Integrated Declarative dependency templating bindings tracking
  9. 9. http://knockoutjs.com
  10. 10. SignalRPersistent connection between JS and ASP.NET Open source JavaScript library (MIT license – source on GitHub) ~ 1 year old; active community Community project (not run by Microsoft)
  11. 11. SignalRBrowser JavaScript Long polling / web socketsServer ASP.NET
  12. 12. SignalR http://aegir.pagekite.me/chat
  13. 13. SignalR
  14. 14. SignalR
  15. 15. SignalR
  16. 16. More informationhttp://knockoutjs.comhttp://signalr.nethttp://learn.knockoutjs.comhttp://knockmeout.net
  17. 17. Questions?Ægir ÞorsteinssonLandsbankinn@thorsteinssonhttp://thorsteinsson.is/

×