我正在进行 ember 1.12.1 -> 1.13.11 和 ember data 1.0.0-beta.19.1 -> 1.13.15 更新。我之前有一个模板:
{{a-component parent=model.parent}}
和一个组件
parentChanged: on('init', observer('parent', function() {
var parent = this.get('parent');
if (parent) {
parent.get('child').then(child => {
this.set('child', child);
});
}
}))
这以前有效,但在更新后,调用child
后未定义。then
我不得不把它改成
parentChanged: on('init', observer('parent', function() {
var parent = this.get('parent');
if (parent) {
parent.then(parent => {
parent.get('child').then(child => {
this.set('child', child);
});
});
}
}))
让它像更新前一样恢复工作。
有人知道为什么是这样吗?似乎模板在更新后停止解决承诺。