我已经阅读了文档、api 并浏览了 Ember 的源代码。没运气!
路线:
App.Router.map ->
@resource 'customers', path: 'my_customers', ->
@resource 'customer', path: '/:customer_id', ->
@route 'edit', path: '/my_edit'
App.CustomerEditRoute = Ember.Route.extend
setupController: (controller, model) ->
controller.set('content', model)
alert("inspect: #{Ember.inspect(model)}")
警报输出是“检查:未定义”
如果我检查参数,对象是空的:
App.CustomerEditRoute = Ember.Route.extend
model: (params) ->
alert("inspect: #{Ember.inspect(params)}")
警报输出是“检查:{}”