id: any;
loginsubmit(id: any) {
console.log("button works");
const che = \[\];
this.admincreation.getdatas(id).subscribe((che: any) =\> {
{
const adminl = che.find((b: any) =\> {
return b.loginemail === this.Login.value.loginemail && b.loginpassword ===this.Login.value.loginpassword;
});
if (adminl) {
Swal.fire('success', 'Admin is logged in successfully', 'succes`your text`s');
this.Login.reset();`your text`
this.route.navigate(\['/superadmin'\]);
} else {
// user login logic
this.userLogin(id);
}
}});
}
userLogin(id: any) {
this.sign.getlogin(id).subscribe((res: any) =\> {
{
const user = res.find((b: any) =\> {
return b.loginemail === this.Login.value.loginemail && b.loginpassword === this.Login.value.loginpassword;
});
if (user){
Swal.fire({
icon:'success',
title:'SuccessFully',``` your text``your text ```
text:'Login Successfully',
});
this.route.navigate(\['/generalusers'\]);
this.dialog.open(UseraccesdelogComponent, {
width:'800px',
height:'600px',
});
this.Login.reset();
}
}
});
}
getlogin(id:any){
return this.http.get(this.urls,id);
}
getdatas(id:any){
return this.http.get(this.urls,id);
}
字符串
为什么它不导航到下一页登录后它总是显示che不是一个功能,在网络中它200 ok,但它不导航到下一页,并使用firebase数据库存储所有数据
1条答案
按热度按时间oalqel3c1#
错误消息
che
不是函数”表明变量che
用作函数存在问题。根据您提供的代码,似乎che
既用作数组又用作函数参数,这可能导致错误。字符串
我已经删除了多余的花括号,修复了
Swal.fire
行,并调整了代码中的一些注解。确保代码的结构如上所示,并且在正确登录后应该导航到下一页。@Priyasingh如果你有,请问。