Setting up a controller property after the model hook

后端 未结 2 395
野的像风
野的像风 2021-01-23 11:42

I need to set a controller property after the model hook. I can think of two ways to do this:

model(params) {
  return this.store.findRecord(\'user\         


        
2条回答
  •  孤城傲影
    2021-01-23 12:19

    You don't need any of those code, because controller has access to model via this.model. In any controller's method you can just call this.get('model.profile'). In template you may use {{model.profile}}.

提交回复
热议问题