0
我試圖在另一個函數中使用函數,但即使我事先聲明瞭它,聚合物說它不是。我不明白。任何線索?在聚合物中聲明函數
Polymer({
is: 'x-foo',
//some other code here, including the properties....
computeRange: function (offset, limit, nodeRangeStart, nodeRangeEnd) {
nodeRangeStart.innerText = offset;
nodeRangeEnd.innerText = offset + limit;
},
prevPage: function() {
this.offset = this.offset - this.limit;
computeRange(this.offset, this.limit, this.$.usersListRangeStart, this.$.usersListRangeEnd);
this.$.nextPage.removeAttribute('disabled');
if (this.offset <= 0) {
this.$.prevPage.setAttribute('disabled', true);
this.$.prevPage.style.color = '#DDDDDD';
};
}
});
和控制檯:
未捕獲的ReferenceError:computeRange沒有定義
現在完美的工作!非常感謝,託尼! – SKMTH