【发布时间】:2018-02-23 14:02:08
【问题描述】:
首先我有
<timer #timer [timeInSeconds]="this.store" timerFont></timer></p>
我希望从函数getBalance()中获取Timer的值
getBalance(){
this.restProvider.getBalance(this.user_id)
.then(data => {
this.todos = data;
this.balance = this.todos.balance;
this.timersecs = this.todos.timer;
/// HERE ///
});
}
问题是this.balance 值存储在RestProvider 的函数中,但如果我想从Constructor 或其他函数调用this.balance,我将无法这样做。如何从 RestProvider getBalance() 函数之外的函数中引用值?
【问题讨论】:
-
能否详细说明您的查询?
标签: angular ionic-framework ionic3 angular2-forms