Ember子路径将空记录附加到集合中

时间:2014-12-23 13:36:11

标签: ember.js

将空记录附加到收集的子路径我有一个棘手的问题,我希望你偷看可以帮助。

这可以正常工作但是如果我用位置子路径刷新页面,则位置列表会在末尾附加一条空记录。

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

任何帮助非常感谢

0 个答案:

没有答案