我设法在警报中打开警报。但是当我选择Admin时,我希望在用户选择Admin后关闭第一个警报。
我该怎么做?
showAlert2(message)
{
let alert = this.alertCtrl.create({
title:'Sign in as',
inputs: [
{
type:'checkbox',
label:'Admin',
value:'admin',
handler: data => {
this.showAlert3('Sign in');
}
},
{
type:'checkbox',
label:'Patient',
value:'patient'
}
],
buttons: [
{
text: 'Login',
handler: data => {
// if the user chooses patient open a page
this.navCtrl.push(PMainPage);
// if the user chooses admin i want to create an other alert message
}
}
]
});
alert.present();
}
提前谢谢!
答案 0 :(得分:2)
您可以+
解除当前提醒,因为您使用from operator import itemgetter
a = [[1,128,"11:18:23.456",2,0,0,"P"],[2,1345,"22:18:23.456",2,1,0,"Q"],[3,1365,"24:18:23.456",1,0,0,"N"]]
b = [[1,128,"11:18:23.456",2,0,0,"P"],[2,1345,"22:18:23.456",2,1,0,"Q"],[2,1345,"22:18:23.456",2,1,0,"Q"]]
c_before_sort = a + b
c_after_sort = sorted(c_before_sort, key = itemgetter(1))
print(c_after_sort)
# [[1, 128, '11:18:23.456', 2, 0, 0, 'P'], [1, 128, '11:18:23.456', 2, 0, 0, 'P'], [2, 1345, '22:18:23.456', 2, 1, 0, 'Q'], [2, 1345, '22:18:23.456', 2, 1, 0, 'Q'], [2, 1345, '22:18:23.456', 2, 1, 0, 'Q'], [3, 1365, '24:18:23.456', 1, 0, 0, 'N']]
# easy peezy lemon squeezy
定义了该提醒。
alert.dismiss()