![setRoot setRoot]()
本文介绍了Ionic2:如何在警报提示中输入复选框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 使用Ionic2和angular2: 我想显示一个警告框,其中包含一个文本和复选框 - 要求用户如果他/她同意该陈述。 请帮助!! 解决方案 //提示警报,要求用户验证电子邮件地址.let alert = Alert.create({subTitle:'Email未经验证!',消息:'请检查您的电子邮件以获取验证链接。',输入:[{name:'getLink',标签:'再次获取验证链接?',输入:复选框,值:true,选中:false}],按钮:[{text:'Ok',handler:data => {console.log(data); if(data.length> 0){// console.log('Get me link '); //我们呼唤t他通过邮件向用户发送链接的方法 - 验证他们的电子邮件地址。 user.sendEmailVerification(); this.nav.rootNav.setRoot(首页);返回true; } else {//console.log('Link not required!'); this.nav.rootNav.setRoot(首页);返回true; }}}; this.nav.present(alert); Using Ionic2 and angular2:I want to show an alert box, inside which a text along with checkbox - to ask for user if he/she agree to the statement.Please help!! 解决方案//Prompt an alert, to ask user to verify there email address.let alert = Alert.create({ subTitle: 'Email not verified!', message: 'Please check your email for verification link.', inputs: [ { name: 'getLink', label: 'Get verification link again ?', type: "checkbox", value: "true", checked: false } ], buttons: [ { text: 'Ok', handler: data => { console.log(data); if(data.length > 0) { //console.log('Get me link'); //we are calling this method to sent a link to user over mail - to verify their email address. user.sendEmailVerification(); this.nav.rootNav.setRoot(HomePage); return true; } else { //console.log('Link not required!'); this.nav.rootNav.setRoot(HomePage); return true; } } } ]});this.nav.present(alert); 这篇关于Ionic2:如何在警报提示中输入复选框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 07-24 16:05