Backbone.js
参考:Event Aggregator var MyApp = new Backbone.Marionette.Application(); // Alert the user on the 'minutePassed' event MyApp.vent.on("minutePassed", function(someData){ alert("Received", someData); }); // This will emit an event with the …
model.save(data, options); 第一引数は、登録するデータ。nullならモデルにセットされているデータが使われる。optoinsはsuccessとかerrorとか。 this.model.save(null, { success: function(mod, res, opt){ console.log(res); }, error: function(mod, xh…
ItemViewはシンプルだけど、collectionViewとcompositeViewというのがあるので、使い分けを確認する。 参考1:Marionette.jsまとめ その3 CompositeView, Layout, Region CompositeViewは、テンプレートを設定することができるらしい。CollectionViewは、テ…
http://backbonejs.org/ここのdevelopバージョンを使ってみます。Underscore.jsに依存します。http://underscorejs.org/ jQueryも使います。 モデル var Hoge = Backbone.Model.extend({ defaults:{ 'name': 'taro', 'age': 20, 'updateTime': new Date() },…