ember.js - How to access computed properties in a child controller from a parent resource -
say have routes like
app.router.map(function() { this.resource('month', { path: '/:month_id' }, function() { this.route('summary'); }); });
i think /:month_id/summary
route, default model/controller same /:month_id
route, i'd have access correct month
model , computed properties added monthscontroller
. instead, find have add code:
app.monthsummaryroute = ember.route.extend({ model: function() { return this.modelfor("month"); } }); app.monthsummarycontroller = ember.objectcontroller.extend({ needs: ['month'] });
this seems lot urls point same data, since plan on making many child urls of resource sharing data.
is there better way this? want make sure i'm dong right way.
i guess since using needs
api correct , recommended way share data beetween controllers on right track.
hope helps.
Comments
Post a Comment