ember.js - ember - recommended way to fetch a collection of objects to use as menu options without them being considered part of the model -
i have model foo
has field barid
has belongsto
relationship model named bar
. want have menu of bars set barid value in "new" foo template.
i've created select component displays things properly.
where appropriate place me json fetch of bar collection? i'm assuming should stored in controller decorates model , makes context available template.
doing rsvp.hash()
in router's model()
doesn't seem appropriate me, consider bar
collection part part of foo
model. should using router's aftermodel()/setupcontroller()
, controller's init()
or set somewhere else?
sorry don't have jsfiddle or anything, don't know how set 1 code requires babel.
any appreciated.
it turned out non-issue using ember.rsvp.hash()
in router's model()
without using setupcontroller() defaults model.foo, model.bar, etc, can access in controllers/templates/etc.
what worried other collections/objects fetched store stored along 'model' when did model.save()
, instead i'd using model.foo.save()
,
Comments
Post a Comment