i have fantasy sports app player , team models. i'm trying output query on players model/fixture model iterated template in named outlet. think problem 'availableteams' controller/route/model/route.
i'm trying find on player model players don't have team.
app.availableplayerscontroller = ember.arraycontroller.extend({ availplayers: function() { return app.player.find({league: ''}); // return app.player.find({league: 'mlb'}); // doesn't work either }, });
the template rendering because static text shows up, chrome emberjs debugger shows model of availableplayers having no value. i've searched so, emberjs.com getting started guide , countless jsfiddles, nothings working. don't know if approach wrong, or if i'm missing simple. appreciated.
full jsfiddle here: http://jsfiddle.net/sandalsoft/77p8z/
ps - app multiple-sport fantasy league teams players, don't let team names in player fixture throw you.
edit: updated fiddle runs: http://jsfiddle.net/77p8z/
when use rendertemplate
controller not model route, since there no route. finder used returning promise
, stuff belongs in route. it's catch-22, have manually set content
or model
on controller.
i typically before custom render
. it elsewhere, key set content manually. here's modified rendertemplate
of applicationroute
,
var availcontroller = this.controllerfor('availableplayers'); app.player.find({league: 'epl'}).then(function(result) { availcontroller.set('model', result); }); // render outlet
the updated jsfiddle.
i noticed using rc.3. try switching rc.6 if possible, need async router, , bug fixes in eventually.
Comments
Post a Comment