【发布时间】:2023-03-09 18:20:01
【问题描述】:
代码:
reset(){
let alert = this.AlertCtrl.create({
buttons :['ok']
});
this.userservice.passwordreset(this.email).then((res: any)=>{
if(res.success){
alert.setTitle('Email sent');
alert.setSubTitle('please follow the instructions in the email to reset the password')
}
else{
alert.setTitle('failed');
}
})
}
错误:
属性在类型 void 上不存在,打字稿错误
有人可以通过更正此代码 sn-p 来帮助我,以便“then”功能正常工作 干杯!
【问题讨论】:
-
我无法解决我的查询,因为我不知道应该在重置函数中作为参数传递什么
-
这是打字稿而不是 javascript。了解差异。
void类型的事物没有属性 -
请把密码重置的代码贴出来好吗?
-
你能从你的服务中添加一些代码吗,它返回了什么?
标签: angular typescript typescript2.0