【发布时间】:2018-02-09 15:48:04
【问题描述】:
我有 2 个函数,我试图让其他函数的返回值继续,但返回值始终未定义。
这是我返回值的代码。
export class HomePage {
variables={
a:1,
b:2,
c:3,
}
constructor(public navCtrl: NavController) {
this.function1();
}
function1(){
if(function2()){
alert("true");
}else{
alert("false");
}
}
function2(){
if(this.variables.a + this.variables.b >= this.variables.c){
return true;
}else{
return false;
}
}
}
【问题讨论】:
-
那是组件的一部分吗?您能否向我们展示整个组件代码?
-
@sebaferreras ,我用完整代码保存了对问题的编辑
-
谢谢,如果答案解决了问题,请告诉我:)
标签: angular typescript ionic2 ionic3