小编Kan*_*lik的帖子

属性然后在类型 void 上不存在,打字稿错误

代码:

 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');
    }
  })
}
Run Code Online (Sandbox Code Playgroud)

错误:

属性然后在类型 void 上不存在,打字稿错误

有人可以通过更正此代码片段来帮助我,以便“then”功能正常工作!

typescript typescript2.0 angular

3
推荐指数
1
解决办法
5万
查看次数

标签 统计

angular ×1

typescript ×1

typescript2.0 ×1