【发布时间】:2015-09-23 07:14:53
【问题描述】:
我想调用一个观察者函数'_propChanged',它又调用另外两个_foo() 和_bar()。我该怎么做?
代码
{
is: 'x-el',
properties: {
prop: {
type: String,
notify: true,
observer: '_propChanged'
}
},
_propChanged: function() {
_foo(); // This doesn't work
_bar(); // This doesn't work
},
_foo: function() {
// Do stuff
},
_bar: function() {
// Do stuff
}
}
【问题讨论】:
-
在您的
_observePropChanges函数中尝试使用this._foo()和this._bar()。 -
@miqid 应该这样做。为什么不将其添加为答案?
标签: polymer polymer-1.0