App.Profile = DS.Model.extend({
});
App.User = DS.Model.extend({
profile: DS.belongsTo(App.Profile)
Currently, there are several awkward points to Ember.js controllers. Namely:
- Passing controllers around to view's not instantiated by the routing system is hard.
- Non-singleton controllers are very difficult to manage (e.g. #each where each view has it's own controller).
- Sharing data between controllers is difficult.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Small extension to create a clone of the element without | |
# metamorph binding tags and ember metadata | |
$.fn.extend | |
safeClone: -> | |
clone = $(@).clone() | |
# remove content bindings | |
clone.find('script[id^=metamorph]').remove() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file contains utilities for creating bound helpers | |
// For reference: https://github.com/wagenet/ember.js/blob/ac66dcb8a1cbe91d736074441f853e0da474ee6e/packages/ember-handlebars/lib/views/bound_property_view.js | |
Ember.Handlebars.BoundHelperView = Ember.View.extend(Ember._Metamorph, { | |
context: null, | |
options: null, | |
property: null, | |
// paths of the property that are also observed | |
propertyPaths: [], |
NewerOlder