【发布时间】:2017-08-01 00:40:51
【问题描述】:
我知道以下查询有可用的解决方案,但我是 angular2 的菜鸟,不应该在 void 函数中添加什么,请帮助! enter image description here
export class PasswordResetPage {
email : string;
constructor(public navCtrl: NavController,
public navParams: NavParams ,
public userservice :UserProvider,
public AlertCtrl :AlertController) { }
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');
}
})
}
}
【问题讨论】:
-
您无需添加任何内容,只需将其绑定到变量即可。
-
passwordReset显然不返回任何内容或声明了返回类型void(即使它返回某些内容)。请将代码作为文本添加到问题中,而不仅仅是屏幕截图的链接。 -
谢谢你的回复这里是代码,
标签: angular typescript