mardi 23 décembre 2014

Ember sub route appending empty record to collection

Sub route appending empty record to collectionI've got a bit of a tricky problem and I'm hoping you peeps can help.


This works as expected BUT if I refresh the page with a location sub route the locations list gets an empty record appended to the end.



App.Router.map ->
this.resource 'home', { path: '/' }
this.resource 'locations', ->
this.resource 'location', { path: ':slug' }
this.resource 'services'
this.resource 'contact'
this.resource 'login'

App.LocationsRoute = Ember.Route.extend
model: ->
this.store.find 'location'

App.LocationRoute = Ember.Route.extend
serialize: (model, params)->
slug: model.get 'slug'

model: (params)->
this.store.find 'location', params.slug


Any help greatly appreciated





Aucun commentaire:

Enregistrer un commentaire