How to reload current route in Ember.js?

后端 未结 3 1546
独厮守ぢ
独厮守ぢ 2021-01-01 09:55

in Ember.js I have route with model. Could you help me, when I\'m on route playlist how to reload this route (or set new data to model) called by callback from another JS fu

3条回答
  •  悲哀的现实
    2021-01-01 10:06

    It seems the solution in the answer won't work for current route. I had a same issue and tried the solution here and it worked.

    http://discuss.emberjs.com/t/refresh-current-view-page-after-language-change/4291/5#post_5

    In your route.

    actions: {
      sessionChanged: function() {
        this.refresh();
      }
    }
    

    and in your controller.

    observeSession: function() {
      this.send("sessionChanged");
    }.observes("session.isAuthenticated"),
    

提交回复
热议问题