【发布时间】:2021-07-16 02:29:55
【问题描述】:
这是我的代码。我必须在提交表单时验证用户名和电子邮件。 但是 userno 存在是基于所有用户通用的用户类型和电子邮件验证的条件..
这是代码
save()
{
numexist:false;emailexist:false;
if(type=="Manual")
{
this.userService.IsUserNoExist(no).subscribe({
next: (result: any) => {
numexist=result;
},
error: (error:any) => {
this.close();
}
});
} //if
//Email Check common for all user type
this.userService.IsEmailExist(email).subscribe({
next: (result: any) => {
emailexist=result;
},
error: (error:any) => {
this.close();
}
});
if(numexist==false && emailexist==false)
{ // Here comes before result come from email exist
//Save
}
else
{
//nothify
}
}
我已经编写了多个订阅方法..但是我必须检查两个条件过程保存..请让我知道我必须加入哪个运算符而不是可选情况请帮助我
【问题讨论】: