我有一个简单的警报框,其中包含2个输入字段。我想禁用按钮,直到它们在输入中成为值。当用户输入值时,出现按钮。谁能帮我解决这个问题吗?谢谢
presentPrompt() {
let alert = this.alertCtrl.create({
title: 'Add Your Question',
inputs: [
{
name: 'would',
placeholder: 'Answer 1'
},
{
name: 'rather',
placeholder: 'Answer 2'
}
],
buttons: [
{
text: 'Add',
role: 'add',
handler: data => {
this.wouldquestion = data.would;
this.ratherquestion = data.rather;
this.afd.list("Questions/").push({
answer1:this.wouldquestion,
answer2:this.ratherquestion,
answer2click:this.answer2clicks,
answer1click:this.answer1clicks
});
}
},
]
});
alert.present();
}