Skip to content

Instantly share code, notes, and snippets.

@cloke
Last active December 17, 2015 20:19
Show Gist options
  • Save cloke/5666885 to your computer and use it in GitHub Desktop.
Save cloke/5666885 to your computer and use it in GitHub Desktop.
#The code before the update. Used to work, but now it breaks.
Binders.SpotsEditRoute = Em.Route.extend
model: () ->
Binders.Spot.find 1234
Binders.Router.map ->
@resource 'spots', ->
@route 'new'
@route 'edit', { path: ':spot_id/edit' }
#return a basic object (something without a promise) and it breaks.
Binders.SpotsEditRoute = Em.Route.extend
model: () ->
{test: 'my test'}
#The app works as normal if I load at /spots and then transitionToRoute( 'spots.edit', myModel ).
#So now I am in the edit route #(again everything is fine) and the url is now /spots/1234.
#Refresh the page so now it is loading from /spots/1234, if I return #Binders.Spot.find( 1234 ) from model: it breaks.
#If I return a basic object everything works as expected.
#From what I can tell something breaks when you return an ED object with the new promise code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment