applications: a series of states
DESCRIPTION
Chicago Ember.js Meetup, December 2012TRANSCRIPT
![Page 1: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/1.jpg)
applications: a series of statesa talk by @trek
![Page 2: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/2.jpg)
![Page 3: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/3.jpg)
![Page 4: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/4.jpg)
![Page 5: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/5.jpg)
![Page 6: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/6.jpg)
![Page 7: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/7.jpg)
<a href=”serialize/user/intent.fmt”>
![Page 8: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/8.jpg)
![Page 9: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/9.jpg)
![Page 10: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/10.jpg)
![Page 11: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/11.jpg)
![Page 12: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/12.jpg)
![Page 13: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/13.jpg)
![Page 14: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/14.jpg)
![Page 15: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/15.jpg)
![Page 16: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/16.jpg)
![Page 17: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/17.jpg)
![Page 18: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/18.jpg)
![Page 19: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/19.jpg)
![Page 20: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/20.jpg)
![Page 21: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/21.jpg)
![Page 22: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/22.jpg)
![Page 23: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/23.jpg)
![Page 24: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/24.jpg)
![Page 25: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/25.jpg)
![Page 27: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/27.jpg)
![Page 28: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/28.jpg)
![Page 29: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/29.jpg)
GET https://simple.com/activity/transactions/3a709ef6-c300-43b4-bca0-af72d1ecd4ba
![Page 30: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/30.jpg)
![Page 31: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/31.jpg)
![Page 32: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/32.jpg)
![Page 33: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/33.jpg)
GET https://simple.com/activity/transactions/3a709ef6-c300-43b4-bca0-af72d1ecd4ba/edit
![Page 34: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/34.jpg)
![Page 35: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/35.jpg)
![Page 36: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/36.jpg)
![Page 37: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/37.jpg)
PUT https://simple.com/activity/transactions/3a709ef6-c300-43b4-bca0-af72d1ecd4ba
HTTP 302 Found
GET https://simple.com/activity
![Page 38: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/38.jpg)
![Page 39: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/39.jpg)
![Page 40: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/40.jpg)
ͿԤԥԦԧԨԩԪԫԬԭԮԯՠֈ֍֎֏ࢪࢩࢨࢧࢦࢥࢤࢣࢢࢡࢠࡪࡩࡨࡧࡦࡥࡤࡣࡢࡡࡠ࡞࡛࡚࡙ࡘࡗࡖࡕࡔࡓࡒࡑࡐࡏࡎࡍࡌࡋࡊࡉࡈࡇࡆࡅࡄࡃࡂࡁࡀ࠾࠽࠼࠻࠺࠹࠸࠷࠶࠵࠴࠳࠲࠱࠰࠭ࠬࠫࠪࠩࠨࠧࠦࠥࠤࠣࠢࠡࠠࠟࠞࠝࠜࠛࠚ࠙࠘ࠗࠖࠕࠔࠓࠒࠑࠐࠏࠎࠍࠌࠋࠊࠉࠈࠇࠆࠅࠄࠃࠂࠁࠀ߿߾߽ٟؠׯ
![Page 41: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/41.jpg)
![Page 42: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/42.jpg)
![Page 43: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/43.jpg)
http://imgs.xkcd.com/comics/regular_expressions.png
![Page 44: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/44.jpg)
![Page 45: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/45.jpg)
![Page 47: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/47.jpg)
![Page 48: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/48.jpg)
![Page 49: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/49.jpg)
$('.some-selector').click(function(){ $.ajax({ success: function(response){ var html = $templates.transactionDetails(response); $('#some-section-of-my-page).html(html); } })})
![Page 50: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/50.jpg)
![Page 51: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/51.jpg)
![Page 52: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/52.jpg)
![Page 53: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/53.jpg)
$('.some-selector').click(function(){ $.ajax({ success: function(response){ var html = $templates.transactionDetails(response); $('#some-section-of-my-page).html(html); } })})
![Page 54: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/54.jpg)
![Page 55: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/55.jpg)
![Page 56: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/56.jpg)
![Page 57: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/57.jpg)
$('.some-button').click(function(){ $.ajax({ type: ‘post’, success: function(response){ var html = $templates.transactionDetails(response); $('#some-section-of-my-page).html(html); } })})
![Page 58: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/58.jpg)
![Page 59: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/59.jpg)
![Page 60: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/60.jpg)
decent, not great.
![Page 61: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/61.jpg)
{}
![Page 62: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/62.jpg)
truth-in-dom
JSON, js, html
JSON, js, html
![Page 63: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/63.jpg)
{ vendor: 'Wholefds Kbs', amount: '20.70', isCredit: false, isPending: true, type: 'Groceries', location: { lat: '41.910006', long: '87.657166', address: '1070 N North Branch St,\n Chicago IL 60642' }}
![Page 64: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/64.jpg)
success: function(purchase){ var sidebar = $('#more-info'); if(purchase.isPending) { $('.is-pending', sidebar).show(); } $('.name', sidebar).html(purchase.vendor); $('.amount', sidebar).html('-' + purchase.amount); $('.category', sidebar).html(purchase.type); $('.map', sidebar).gMapPlugin(purchase.location); $('.address', sidebar).html(purchase.location.address);}
![Page 65: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/65.jpg)
success: function(purchase){ var sidebar = $('#more-info'), template = Templates.purchase; sidebar.html(template(purchase)); $('.map', sidebar).gMapPlugin(purchase.location);}
![Page 66: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/66.jpg)
truth-in-dom
JSON, js, html
JSON, js, html
![Page 67: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/67.jpg)
truth-in-dom
JSON, js, html
truth-in-domJSON, js,
html
truth-in-dom
![Page 68: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/68.jpg)
![Page 69: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/69.jpg)
![Page 70: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/70.jpg)
![Page 71: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/71.jpg)
success: function(purchase){ var sidebar = $('#more-info'), listItem = $(‘#list .purchase-’ + purchase.id), purchaseTemplate = Templates.purchase.show, purchaseTableRowTemplate = Templates.purchase.row; sidebar.html(purchaseTemplate(purchase)); listItem.html(purchaseTableRowTemplate(purchase)); $('.map', sidebar).gMapPlugin(purchase.location);}
![Page 72: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/72.jpg)
![Page 73: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/73.jpg)
![Page 74: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/74.jpg)
![Page 75: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/75.jpg)
<div id=”purchase-list”></div>
![Page 76: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/76.jpg)
View
![Page 77: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/77.jpg)
Collection of Models
![Page 78: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/78.jpg)
View
View
View
View
View
View
View
![Page 79: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/79.jpg)
Properties of the collection
![Page 80: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/80.jpg)
<div id=”details”></div>
![Page 81: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/81.jpg)
View
![Page 82: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/82.jpg)
Aggregation of Collection
![Page 83: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/83.jpg)
Different View
![Page 84: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/84.jpg)
Single Model
![Page 86: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/86.jpg)
![Page 87: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/87.jpg)
app.Purchase = Backbone.Model.extend();
app.PurchaseList = Backbone.Collection.extend({ model: app.Purchase});app.PurchaseList.url = ‘purchases’
app.Purchases = new app.PurchaseList;
![Page 88: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/88.jpg)
app.PurchaseListView = Backbone.View.extend({el: ‘#purchase-list’,
initialize: function(){ this.collection = app.Purchases; this.collection.on('change', this.render, this) this.render(); }, render: function(){
this.$el.append(new PurchasesFilterView().render()); _.each(this.collection.models, function (item) { this.$el.append(new PurchaseRowView({model: item})
.render()); }, this); }});
![Page 89: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/89.jpg)
app.PurchaseRowView = Backbone.View.extend({ initialize: function() { this.model.on( 'change', this.render, this ); }, tagName: 'li', template: ..., events: {
'click': 'toggleMoreDetails', 'click .edit': 'toggleEdit'},
toggleMoreDetails: function(){ this.model.toggleMoreDetails(); this.$el.toggleClass( 'selected', this.moreDetailsShowing); }, render: function(){ this.$el.html(this.template(this.model)) }});
![Page 90: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/90.jpg)
app.PurchaseDetailsView = Backbone.View.extend({el: ‘#details’,
initialize: function(){ this.render(); }, template: '...', render: function(){
this.$el.html(this.template(this.model); }});
![Page 91: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/91.jpg)
app.Purchases.fetch();
![Page 92: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/92.jpg)
<div id=”purchase-list”></div>
![Page 93: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/93.jpg)
render: function(){this.$el.append(new PurchasesFilterView().render());
_.each(this.collection.models, function (item) { this.$el.append(new PurchaseRowView({model: item})
.render()); }, this); }
![Page 94: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/94.jpg)
![Page 95: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/95.jpg)
![Page 96: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/96.jpg)
![Page 97: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/97.jpg)
app.PurchaseRowView = Backbone.View.extend({...
events: { 'click': 'toggleMoreDetails' }, toggleMoreDetails: function(){ this.model.toggleMoreDetails(); this.$el.toggleClass( 'selected', this.moreDetailsShowing); }});
![Page 98: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/98.jpg)
![Page 99: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/99.jpg)
![Page 100: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/100.jpg)
![Page 101: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/101.jpg)
![Page 102: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/102.jpg)
![Page 103: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/103.jpg)
![Page 104: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/104.jpg)
![Page 105: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/105.jpg)
truth-in-data
truth-in-datatruth-in-data
![Page 106: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/106.jpg)
model.on(‘change’)/collection.on(‘change’)
-> render
model.on(‘change’)-> render
model.on(‘change’)-> render
![Page 107: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/107.jpg)
{}
![Page 108: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/108.jpg)
![Page 109: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/109.jpg)
![Page 110: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/110.jpg)
<div id=”purchase-list”>
<div id=”details”></div>
<div id=”dashboard”>
</div>
<div id=”sidebar”>
</div>
<div id=”map”></div>
</div>
![Page 111: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/111.jpg)
app.DashboardView = Backbone.View.extend({ render: function(){
this.$el.append(new app.PurchaesView().render().el);this.$el.append(new app.PurchaesMapView().render().el);this.$el.append(new app.PurcaseDetailView().render().el);
}});
![Page 112: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/112.jpg)
http://lostechies.com/derickbailey/2011/09/15/zombies-run-managing-page-transitions-in-backbone-apps/
![Page 113: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/113.jpg)
<div id=”purchase-list”>
<div id=”details”></div>
<div id=”dashboard”>
</div>
<div id=”sidebar”>
</div>
<div id=”map”></div>
</div>
![Page 114: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/114.jpg)
![Page 115: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/115.jpg)
![Page 116: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/116.jpg)
![Page 117: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/117.jpg)
![Page 118: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/118.jpg)
possible, but you must be cautious
![Page 119: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/119.jpg)
![Page 120: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/120.jpg)
![Page 121: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/121.jpg)
![Page 122: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/122.jpg)
{{view App.NavigationView}}
{{view App.SummaryView}}
![Page 123: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/123.jpg)
{{ outlet }}
![Page 124: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/124.jpg)
![Page 125: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/125.jpg)
![Page 126: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/126.jpg)
![Page 127: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/127.jpg)
![Page 128: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/128.jpg)
![Page 129: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/129.jpg)
![Page 130: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/130.jpg)
![Page 131: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/131.jpg)
![Page 132: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/132.jpg)
Purchases
Index Viewing Editing
![Page 133: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/133.jpg)
Purchases
Index Viewing Editing
![Page 134: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/134.jpg)
Purchases
Index Viewing Editing
![Page 135: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/135.jpg)
Purchases
Index Viewing Editing
![Page 136: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/136.jpg)
Purchases
Index Viewing Editing
![Page 137: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/137.jpg)
Purchases
Index Viewing Editing
![Page 138: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/138.jpg)
Purchases
Index Viewing Editing
![Page 139: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/139.jpg)
Purchases
Index Viewing Editing
![Page 140: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/140.jpg)
Purchases
Index Viewing Editing
![Page 141: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/141.jpg)
Purchases
Index Viewing Editing
![Page 142: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/142.jpg)
Purchases
Index Viewing Editing
![Page 143: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/143.jpg)
App = Ember.Application.create();
App.ApplicationView = Ember.View.extend({ templateName: 'application'});
App.ApplicationController = Ember.Controller.extend();
App.Router = Ember.Route.extend({ root: Ember.Route.extend({}) // this happens for you: ‘shared instance’// applicationController: App.ApplicationController.create()
})
![Page 144: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/144.jpg)
{{view App.NavigationView}}{{view App.SummaryView}}
{{outlet mainArea}}{{outlet detailsArea}}
application.handlebars
![Page 145: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/145.jpg)
{{view App.NavigationView}}{{view App.SummaryView}}
{{outlet mainArea}}{{outlet detailsArea}}
application.handlebars
![Page 146: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/146.jpg)
{{view App.NavigationView}}{{view App.SummaryView}}
{{outlet mainArea}}{{outlet detailsArea}}
application.handlebars
![Page 147: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/147.jpg)
{{view App.NavigationView}}{{view App.SummaryView}}
{{outlet mainArea}}{{outlet detailsArea}}
application.handlebars
![Page 148: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/148.jpg)
{{view App.NavigationView}}{{view App.SummaryView}}
{{outlet mainArea}}{{outlet detailsArea}}
application.handlebars
![Page 149: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/149.jpg)
Purchases
Index Viewing Editing
![Page 150: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/150.jpg)
App = Ember.Application.create();
App.ApplicationView = Ember.View.extend({ templateName: 'application'});
App.ApplicationController = Ember.Controller.extend();
App.Router = Ember.Route.extend({ root: Ember.Route.extend({})})
![Page 151: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/151.jpg)
App = Ember.Application.create();
App.ApplicationView = Ember.View.extend({ templateName: 'application'});
App.ApplicationController = Ember.Controller.extend();
App.Router = Ember.Route.extend({ root: Ember.Route.extend({ purchases: Ember.Route.extend({ index: Ember.Route.extend({ }) }) })});
![Page 152: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/152.jpg)
{{view App.NavigationView}}{{view App.SummaryView}}
{{outlet mainArea}}{{outlet detailsArea}}
application.handlebars
![Page 153: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/153.jpg)
App = Ember.Application.create();
App.ApplicationView = Ember.View.extend({ templateName: 'application'});
App.ApplicationController = Ember.Controller.extend();
App.Router = Ember.Route.extend({ root: Ember.Route.extend({ purchases: Ember.Route.extend({ index: Ember.Route.extend({ }) }) })});
![Page 154: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/154.jpg)
purchases: Ember.Route.extend({ index: Ember.Route.extend({ })})
![Page 155: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/155.jpg)
purchases: Ember.Route.extend({ index: Ember.Route.extend({ connectOutlets: function(router){
var controller = router.get('applicationController'), purchases = App.Purchase.find(), locations = purchases.get('locations'); controller.connectOutlet('mainArea', 'purchaseList', purchases); controller.connectOutlet('detailsArea', 'map', locations); } })})
![Page 156: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/156.jpg)
purchases: Ember.Route.extend({ index: Ember.Route.extend({ connectOutlets: function(router){
var controller = router.get('applicationController'), purchases = App.Purchase.find(), locations = purchases.get('locations'); controller.connectOutlet('mainArea', 'purchaseList', purchases); controller.connectOutlet('detailsArea', 'map', locations); } })})
where? what? data context?
![Page 157: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/157.jpg)
controller.connectOutlet('mainArea', 'purchaseList', purchases);
![Page 158: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/158.jpg)
controller.connectOutlet('mainArea', 'purchaseList', purchases);
App.PurchaseListView = Ember.View.extend({ templateName: 'purchaseList'});App.PurchaseListController = Ember.ArrayController.extend();
![Page 159: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/159.jpg)
Ember.ArrayController.extend();
proxy/presenter/controller/thingie
![Page 160: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/160.jpg)
proxy
content
![Page 161: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/161.jpg)
proxy
content
what’s your length?
![Page 162: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/162.jpg)
proxy
content
how are you sorted?
![Page 163: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/163.jpg)
controller.connectOutlet('mainArea', 'purchaseList', purchases);
App.PurchaseListView = Ember.View.extend({ templateName: 'purchaseList'});App.PurchaseListController = Ember.ArrayController.extend();
![Page 164: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/164.jpg)
controller.connectOutlet('mainArea', 'purchaseList', purchases);
App.PurchaseListView = Ember.View.extend({ templateName: 'purchaseList'});App.PurchaseListController = Ember.ArrayController.extend();
{{#each purchase in controller}} <li> {{purchase.date}} {{purchase.location}} {{purchase.amount}} </li>{{/each}}
![Page 165: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/165.jpg)
controller.connectOutlet('mainArea', 'purchaseList', purchases);
App.PurchaseListView = Ember.View.extend({ templateName: 'purchaseList'});App.PurchaseListController = Ember.ArrayController.extend();
{{#each purchase in controller}} <li> {{purchase.date}} {{purchase.location}} {{purchase.amount}} </li>{{/each}}
![Page 166: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/166.jpg)
purchases: Ember.Route.extend({ index: Ember.Route.extend({ connectOutlets: function(router){
var controller = router.get('applicationController'), purchases = App.Purchase.find(), locations = purchases.get('locations'); controller.connectOutlet('mainArea', 'purchaseList', purchases); controller.connectOutlet('detailsArea', 'map', locations); } })})
![Page 167: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/167.jpg)
purchases: Ember.Route.extend({ index: Ember.Route.extend({ connectOutlets: function(router){
var controller = router.get('applicationController'), purchases = App.Purchase.find(), locations = purchases.get('locations'); controller.connectOutlet('mainArea', 'purchaseList', purchases); controller.connectOutlet('detailsArea', 'map', locations); } })})
where? what? data context?
![Page 168: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/168.jpg)
controller.connectOutlet('detailsArea', 'map', locations);
![Page 169: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/169.jpg)
App.MapView = Ember.View.extend({ templateName: 'googleMap'});App.MapController = Ember.ArrayController.extend();
controller.connectOutlet('detailsArea', 'map', locations);
![Page 170: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/170.jpg)
controller.connectOutlet('detailsArea', 'map', locations);
App.MapView = Ember.View.extend({ templateName: 'googleMap'});App.MapController = Ember.ArrayController.extend();
![Page 171: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/171.jpg)
controller.connectOutlet('detailsArea', 'map', locations);
App.MapView = Ember.View.extend({ templateName: 'googleMap'});App.MapController = Ember.ArrayController.extend();
![Page 172: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/172.jpg)
controller.connectOutlet('detailsArea', 'map', locations);
App.MapView = Ember.View.extend({ templateName: 'googleMap'});App.MapController = Ember.ArrayController.extend();
![Page 173: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/173.jpg)
Purchases
Index Viewing Editing
![Page 174: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/174.jpg)
Purchases
Index Viewing Editing
![Page 175: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/175.jpg)
{{#each purchase in controller}} <li> {{purchase.date}} {{purchase.location}} {{purchase.amount}} </li>{{/each}}
![Page 176: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/176.jpg)
{{#each purchase in controller}} <li {{action showDetails purchase}}> {{purchase.date}} {{purchase.location}} {{purchase.amount}} </li>{{/each}}
![Page 177: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/177.jpg)
purchases: Ember.Route.extend({ index: Ember.Route.extend({ connectOutlets: function(router){
... } })})
![Page 178: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/178.jpg)
purchases: Ember.Route.extend({ index: Ember.Route.extend({ showDetails: Ember.Route.transitionTo(‘viewing’), connectOutlets: function(router){
... } })})
![Page 179: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/179.jpg)
purchases: Ember.Route.extend({ index: Ember.Route.extend({ showDetails: Ember.Route.transitionTo(‘viewing’), connectOutlets: function(router){
... } }), viewing: Ember.Route.extend({ })
})
![Page 180: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/180.jpg)
Purchases
Index Viewing Editing
![Page 181: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/181.jpg)
Purchases
Index Viewing Editing
![Page 182: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/182.jpg)
purchases: Ember.Route.extend({ index: Ember.Route.extend({ showDetails: Ember.Route.transitionTo(‘viewing’), connectOutlets: function(router){
... } }), viewing: Ember.Route.extend({ connectOutlets: function(router, context){ var controller = router.get('applicationController'); controller.
connectOutlet('detailsArea', 'purchaseDetails', context);}
})})
where? what? data context?
![Page 183: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/183.jpg)
purchases: Ember.Route.extend({ index: Ember.Route.extend({ showDetails: Ember.Route.transitionTo(‘viewing’), connectOutlets: function(router){
... } }), viewing: Ember.Route.extend({ connectOutlets: function(router, context){ var controller = router.get('applicationController'); controller.
connectOutlet('detailsArea', 'purchaseDetails', context);}
})})
![Page 184: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/184.jpg)
purchases: Ember.Route.extend({ index: Ember.Route.extend({ showDetails: Ember.Route.transitionTo(‘viewing’), connectOutlets: function(router){
... } }), viewing: Ember.Route.extend({ connectOutlets: function(router, context){ var controller = router.get('applicationController'); controller.
connectOutlet('detailsArea', 'purchaseDetails', context);}
})})
{{#each purchase in controller}} <li {{action showDetails purchase}}> {{purchase.date}} {{purchase.location}} {{purchase.amount}} </li>{{/each}}
![Page 185: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/185.jpg)
controller.connectOutlet('detailsArea', 'purchaseDetails', context);
![Page 186: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/186.jpg)
controller.connectOutlet('detailsArea', 'purchaseDetails', context);
App.PurchaseDetailsView = Ember.View.extend({ templateName: 'details'});App.PurchaseDetailsController = Ember.ObjectController.extend();
![Page 187: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/187.jpg)
controller.connectOutlet('detailsArea', 'purchaseDetails', context);
App.PurchaseDetailsView = Ember.View.extend({ templateName: 'details'});App.PurchaseDetailsController = Ember.ObjectController.extend();
![Page 188: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/188.jpg)
<div class='actions'> <a {{action editPurchase content}}>
Edit</a>
<a href='...'>Support</a></div>
{{#if pending}} <h3>
This transaction is pending...</h3>
{{/if}}
{{name}}{{amount}}{{label}}
App.PurchaseDetailsView = Ember.View.extend({ templateName: 'details'});App.PurchaseDetailsController = Ember.ObjectController.extend();
![Page 189: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/189.jpg)
App.PurchaseDetailsView = Ember.View.extend({ templateName: 'details'});App.PurchaseDetailsController = Ember.ObjectController.extend();
<div class='actions'> <a {{action editPurchase content}}>
Edit</a>
<a href='...'>Support</a></div>
{{#if pending}} <h3>
This transaction is pending...</h3>
{{/if}}
{{name}}{{amount}}{{label}}
![Page 190: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/190.jpg)
Ember.ObjectController.extend();
![Page 191: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/191.jpg)
proxy
content
Ember.ObjectController.extend();
![Page 192: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/192.jpg)
proxy
content
are you pending?
![Page 193: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/193.jpg)
App.PurchaseDetailsView = Ember.View.extend({ templateName: 'details'});App.PurchaseDetailsController = Ember.ObjectController.extend();
<div class='actions'> <a {{action editPurchase content}}>
Edit</a>
<a href='...'>Support</a></div>
{{#if pending}} <h3>
This transaction is pending...</h3>
{{/if}}
{{name}}{{amount}}{{label}}
![Page 194: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/194.jpg)
![Page 195: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/195.jpg)
Purchases
Index Viewing Editing
![Page 196: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/196.jpg)
Purchases
Index Viewing Editing
![Page 197: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/197.jpg)
<div class='actions'> <a {{action editPurchase content}}>
Edit</a>
<a href='...'>Support</a></div>
{{#if pending}} <h3>
This transaction is pending...</h3>
{{/if}}
{{name}}{{amount}}{{label}}
![Page 198: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/198.jpg)
purchases: Ember.Route.extend({ index: Ember.Route.extend({ showDetails: Ember.Route.transitionTo(‘viewing’), connectOutlets: function(router){
... } }), viewing: Ember.Route.extend({ connectOutlets: function(router, context){ var controller = router.get('applicationController'); controller.
connectOutlet('detailsArea', 'purchaseDetails', context);}
})})
![Page 199: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/199.jpg)
purchases: Ember.Route.extend({ index: Ember.Route.extend({ showDetails: Ember.Route.transitionTo(‘viewing’), connectOutlets: function(router){
... } }), viewing: Ember.Route.extend({ editPurchase: Ember.Route.transitionTo(‘editing’), connectOutlets: function(router, context){ var controller = router.get('applicationController'); controller.
connectOutlet('detailsArea', 'purchaseDetails', context);}
})})
![Page 200: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/200.jpg)
purchases: Ember.Route.extend({ index: Ember.Route.extend({ showDetails: Ember.Route.transitionTo(‘viewing’), connectOutlets: function(router){
... } }),editing: Ember.Route.extend({ connectOutlets: function(router, context){
var controller = router.get('applicationController'); controller. connectOutlet('detailsArea', 'editPurchaseDetails', context); }}),
viewing: Ember.Route.extend({ editPurchase: Ember.Route.transitionTo(‘editing’), connectOutlets: function(router, context){ var controller = router.get('applicationController'); controller.
connectOutlet('detailsArea', 'purchaseDetails', context);}
})})
![Page 201: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/201.jpg)
purchases: Ember.Route.extend({ index: Ember.Route.extend({ showDetails: Ember.Route.transitionTo(‘viewing’), connectOutlets: function(router){
... } }),editing: Ember.Route.extend({ connectOutlets: function(router, context){
var controller = router.get('applicationController'); controller. connectOutlet('detailsArea', 'editPurchaseDetails', context); }}),
viewing: Ember.Route.extend({ editPurchase: Ember.Route.transitionTo(‘editing’), connectOutlets: function(router, context){ var controller = router.get('applicationController'); controller.
connectOutlet('detailsArea', 'purchaseDetails', context);}
})})
where? what? data context?
![Page 202: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/202.jpg)
connectOutlet('detailsArea', 'editPurchaseDetails', context);
![Page 203: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/203.jpg)
connectOutlet('detailsArea', 'editPurchaseDetails', context);
App.EditPurchaseDetailsView = Ember.View.extend({ templateName: 'edit-details'});App.EditPurchaseDetailsController = Ember.ObjectController.extend();
![Page 204: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/204.jpg)
connectOutlet('detailsArea', 'editPurchaseDetails', context);
App.EditPurchaseDetailsView = Ember.View.extend({ templateName: 'edit-details'});App.EditPurchaseDetailsController = Ember.ObjectController.extend();
<a {{action save context}}>Save</a><a {{action cancel}}>Cancel</a>
{{view Ember.TextField valueBinding="name"}}
![Page 205: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/205.jpg)
connectOutlet('detailsArea', 'editPurchaseDetails', context);
App.EditPurchaseDetailsView = Ember.View.extend({ templateName: 'edit-details'});App.EditPurchaseDetailsController = Ember.ObjectController.extend();
<a {{action save context}}>Save</a><a {{action cancel}}>Cancel</a>
{{view Ember.TextField valueBinding="name"}}
![Page 206: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/206.jpg)
Ember.ObjectController.extend();
![Page 207: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/207.jpg)
proxy
content
Ember.ObjectController.extend();
![Page 208: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/208.jpg)
proxy
content
what’s your name?
![Page 209: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/209.jpg)
![Page 210: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/210.jpg)
![Page 211: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/211.jpg)
Purchases
Index Viewing Editing
![Page 212: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/212.jpg)
Purchases
Index Viewing Editing
![Page 213: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/213.jpg)
purchases: Ember.Route.extend({ index: Ember.Route.extend({ showDetails: Ember.Route.transitionTo(‘viewing’), connectOutlets: function(router){
... } }),editing: Ember.Route.extend({ saveChanges: Ember.Route.transitionTo(‘index’), connectOutlets: function(router, context){
... }}),
viewing: Ember.Route.extend({ editPurchase: Ember.Route.transitionTo(‘editing’), connectOutlets: function(router, context){
... })})
![Page 214: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/214.jpg)
Purchases
Index Viewing Editing
![Page 215: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/215.jpg)
Demeter’d
![Page 217: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/217.jpg)
![Page 218: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/218.jpg)
> 7 views
![Page 219: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/219.jpg)
![Page 220: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/220.jpg)
![Page 221: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/221.jpg)
![Page 222: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/222.jpg)
![Page 223: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/223.jpg)
which pattern, when?
![Page 224: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/224.jpg)
• app is just a series of documents• or you’re just coding single page• not a client app• manipulation mostly presentational• few data communications• user interaction brief, simple, infrequent
![Page 225: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/225.jpg)
• app is series of documents• with “islands of richness”• occassional data communications• multiple parts of a page need to reflect data• shallow view hierarchy (1-2 levels)• small number of views (~7)• user interaction brief and/or infrequent
![Page 226: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/226.jpg)
• frequent data communications• many parts of a page need to reflect data• deep view hierarchy (2-3+)• large number of views• user will remain for large amounts of time• and/or frequently return• server is just an api• you’d *almost* write a desktop/iOS app
![Page 227: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/227.jpg)
Mobile Cocoa TouchAndroid SDK
Desktop Cocoa.NET
Web ?
![Page 228: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/228.jpg)
Mobile Cocoa TouchAndroid SDK
Desktop Cocoa.NET
Web
![Page 229: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/229.jpg)
User Interface HTML+CSS
Data Persistence
Application Architecture
![Page 230: Applications: A Series of States](https://reader033.vdocument.in/reader033/viewer/2022051609/547d36b2b47959ac508b4887/html5/thumbnails/230.jpg)
fin