Adam Sunderland / @iterion
Issues/Limitations (for us)
Molecule.NotesFieldComponent = Em.Component.extend
actions:
toggleNotes: ->
@toggleProperty('showNotes')
<div class="notes-label" {{action toggleNotes}}>
{{yield}}
</div>
{{#if showNotes}}
<div class="notes-body">
{{textarea value=notes}}
</div>
{{/if}}
{{#notes-field notes=trade.notes}}
<i class="icon-file-text"></i>
<span>Notes</span>
{{/notes-field}}
Molecule.NotesFieldComponent = Em.Component.extend
actions:
toggleNotes: ->
@toggleProperty('showNotes')
<div class="notes-label" {{action toggleNotes}}>
{{yield}}
</div>
{{#if showNotes}}
<div class="notes-body">
{{textarea value=notes}}
</div>
{{/if}}
{{#notes-field notes=trade.notes}}
<i class="icon-file-text"></i>
<span>Notes</span>
{{/notes-field}}
Better code reuse throughout our app (we used the above in 3 different places and on two different models)
self.productName = ko.computed(function () {
if (self.product()) {
return self.product().name;
}
});
productName: function () {
return this.get('product.name');
}.property('product.name')
productName: Ember.computed.alias 'product.name'
<span data-bind="text: productName"><span>
{{productName}}
Turns this:
http://molecule.io/trades
into
Routes are hierarchical
ApplicationRoute > TradesRoute > TradesIndexRoute
Usability win for SPA
Reduced asset loading
wow
much conventions
so confuse
?
?
?
ActiveModelSerializer in Ruby
DS.ActiveModelSerializer in Ember-Data
It just works
Find all trades
@store.find('trade')
trade by id
@store.find('trade', 1)
arbitrary query
@store.find('trade', {product: "Ethane"})
promises
@store.find('trade', 1).then (trade) ->
#called after ajax finishes and model is created
trade.get('price')
updates
trade.set('price', 25);
trade.get('isDirty'); #true
trade.save();
convention over configuration
opinionated
It was hard, but now it's much easier with ember-testing
No Ember "gems"
Limited libraries/components to use
Sometimes hard to integrate with existing stuff (bootstrap in particular is a pain)
Adam Sunderland / @iterion
doge language consultant: Hana Wang / @hahahanahaha