App.Game = DS.Model.extend
players: DS.hasMany 'App.Player'
moreThanOnePlayer: (->
promise = @get('players') #triggers ajax call that returns a promise
promise.then(
(players) -> #promise success call back
console.log players.length > 1 #=> this prints out the correct value
)
#but the return value of the function is still a promise, which always evaluates to true.
return promise
).property('players')
Last active
December 21, 2015 22:29
-
-
Save Chandler/6375929 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment