Why isn't my ember.js route model being called?

后端 未结 3 1377
[愿得一人]
[愿得一人] 2020-12-09 02:37

I just started learning Ember.js (bought the PeepCode screencast), and am learning quite smoothly from it, but ran into a problem when trying to write my first Ember app.

3条回答
  •  南方客
    南方客 (楼主)
    2020-12-09 03:29

    Force Ember to use the model hook; just pass the id instead of the object:

    {{#link-to 'place' place.id}}
        {{place.name}}
    {{/link-to}}
    

    As Ember no longer knows which object is related to given id, Ember will call the model hook (and so the data will be loaded from the server).

提交回复
热议问题