guys I’m trying to pass information from my JSON to this alert, I’m a little new with ionic, could someone help me?
TS:
ionViewDidLoad() {
this.qrCodeProvide.getBrowsers().then((data: any)=>{
data.map((name) => {
console.log(name)
})
console.log(data, 'ok');
this.browsers = data;
});
console.log('ionViewDidLoad VetwebPage');
}
//botao para enviar para camera
openQrcode(){
this.navCtrl.push(QrcodePage, {animate: true} );
}
//alert para mostrar informações do navegador
presentAlert() {
let alert = this.alertCtrl.create({
title: 'Information',
subTitle: 'Browser: ',
message: 'Last active session on: {b.name}',
buttons: ['Disconnect', 'Exit'],
});
alert.present();
}
JSON:
{
"browsers": [ {
"id": "1",
"name": "Chrome",
"date": "20 de Junho 2021 - 14:00"
},
{
"id": "2",
"name": "Firefox",
"date": "15 de Janeiro 2021 - 21:00"
},
{
"id": "3",
"name": "Safari",
"date": "05 de Dezembro 2020 - 15:32"
},
{
"id": "4",
"name": "Opera",
"date": "07 de Março 2021 - 14:21"
},
{
"id": "5",
"name": "Edge",
"date": "25 de Junho 2021"
}]
}
1 post - 1 participant