Knockout.jsの概要

 Knockout.jsの概要

Knockout.jsの概要 (3つのMVC系人気フレームワーク、Backbone.js/AngularJS/Knockout.js) - Build Insider Offline #1

Sample Code: http://mayuki.github.io/Sample/BuildInsiderOffline-1/
PDF: http://sdrv.ms/11qcEWc
PowerPoint: http://sdrv.ms/15GZzfu

1fe26e11357f3ba7250b6668ca61309f?s=128

Mayuki Sawatari

June 08, 2013
Tweet

Transcript

  1. 9.
  2. 10.
  3. 12.

    var

  4. 15.
  5. 20.

    var ' ' var ' ' var function return //

    => 'S' // value1 ’S’ // => S
  6. 21.
  7. 22.

    var ' ' // var ' ' var function return

    function // => ' ' // observable // ‘ ’ ' ' // // =>
  8. 24.
  9. 26.

    View Model JavaScript function ViewModel () { this.lastName = ko.observable('

    '); this.firstName = ko.observable(' '); this.fullName = ko.computed(function () { return this.lastName() + this.firstName(); }, this); }
  10. 27.

    HTML (data-bind ) div id target input type text data-bind

    value: lastName input type text data-bind value: firstName span data-bind text: fullName /span div
  11. 29.
  12. 30.

    DOM

  13. 31.
  14. 33.
  15. 35.