我有2个函数,我试图让其他函数的返回值继续,但返回值始终未定义。如何获得离子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
@sebaferreras,我用我的完整代码保存了我的问题编辑 –
谢谢,请让我知道如果答案解决了问题:) – sebaferreras