gpt4 book ai didi

ember.js - 如何在Ember中获取父 View 的属性?

转载 作者:行者123 更新时间:2023-12-03 13:46:18 25 4
gpt4 key购买 nike

这可能不容易,但是我很难弄清楚如何访问父 View 的属性:

App.ParentView = Ember.View.extend({
foo: 'bar',

child_view: Ember.View.extend({

init: function(){
// get the value of App.ParentView.foo
// ???
}
})

});

最佳答案

获取 View :this.get('parentView')
获取foo this.get('parentView.foo')的值

关于ember.js - 如何在Ember中获取父 View 的属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9279696/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com