Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
more () : void {
this.nav.present(Alert.create({
title: 'About',
subTitle: 'This application was created by Ibrahim Hadeed',
buttons: [
'Close',
{
text: 'View Github Profile',
handler: () => {
// TODO open inappbrowser here
}
}
]
}));
}
show(type, content) {
let alert = Alert.create({
title: type,
subTitle: content,
buttons: [{
text: 'Ok',
handler: () => {
let navTransition = alert.dismiss();
//if(!flag){return false;}
// navTransition.then(() => {
// this.nav.pop();
// });
return false;
}
}]
});
this.nav.present(alert);
}
itemSelected(item){
let confirm = Alert.create({
title: '晴宝',
message: '你确定要取消关注该城市的天气信息吗?',
buttons: [
{
text: '取消',
},
{
text: '确定',
handler: () => {
var id = item.id;
this.local.set('distrct' + id, "");
this.local.set('weather' + id, "");
this.local.set('temperature' + id, "");
this.local.set('picture' + id, "");
this.local.get('num').then((result) => {
console.log('num => ' + result);
showOptionInfo() {
let alert = Alert.create({
title: 'Width & Height Options',
subTitle: 'When the width and height options are set to 0 your video will be transcoded with its original dimensions.',
buttons: ['Gotcha']
});
this.nav.present(alert);
}
}
.then(function () {
let t = Alert.create({
title: '修改成功!',
subTitle: '已向您邮箱发送一封确认邮件,确认后即修改成功。',
buttons: [{
text: 'OK',
handler: () => {
context.close();
}
}]
});
context.nav.present(t);
});
}
checkUpdate() {
let alert = Alert.create({
title: '检查更新',
buttons: ['OK']
});
this.data.version(this.nav)
.then(
data => {
alert.setSubTitle('已是最新版本~');
this.nav.present(alert);
}
)
.catch(
data => {
alert.setSubTitle('需要更新!');
this.nav.present(alert);
}
)
addAttach(){
let alert = Alert.create({
title: 'Login',
inputs: [
{
name: 'title',
placeholder: '标题'
},
{
name: 'url',
value:'http://',
type: 'url'
}
],
buttons: [
{
text: '取消',
role: 'cancel'
changeUsername() {
let alert = Alert.create({
title: 'Change Username',
buttons: [
'Cancel'
]
});
alert.addInput({
name: 'username',
value: this.username,
placeholder: 'username'
});
alert.addButton({
text: 'Ok',
handler: data => {
this.userData.setUsername(data.username);
this.getUsername();
}
quantityMinus(item){
if(item.quantity > 1){
this.cartService.quantityMinus(item);
} else {
let alert = Alert.create({
title: 'Error',
subTitle: 'Quantity is 1, you cant reduce it, if you want to remove, please press remove button.',
buttons: ['Ok']
});
this.nav.present(alert);
}
}
constructor(private nav: NavController,
private navParams: NavParams,
private plugins: Plugins,
private ngZone: NgZone) {
this.images = this.navParams.get("images");
if(!this.images || this.images.length == 0) {
let alert = Alert.create({
title: "Error",
subTitle: "No images found to upload",
buttons: ['Ok']
});
nav.present(alert);
return;
}
this.total = this.images.length;
this.upload(this.images[0]);
}