0
我想知道什麼是最好的方法是延遲加載我的模型數據直到動畫完成。延遲數據加載,直到動畫在emberjs中完成
在我的應用程序中,我正在監聽路由的更改。然後,當某條路線匹配時,我用動畫打開一個面板。但我希望在動畫完成後開始加載數據。
以下是我聽的路線:
App.ApplicationController.reopen({
currentPathChanged:function() {
App.panelView.setNeedsOpen(this.get('currentPath') == 'index' ? false : true);
}.observes('currentPath')
});
這是被稱爲當面板具有開路線之一:
App.NewsitemsRoute = Ember.Route.extend({
model: function() {
return App.Newsitem.find();
}
});
但正如你所看到的,數據在動畫仍在運行時被預加載。我應該如何解決這個問題?