I made an app using ionic v1
using the same properties as the documentation of ionic v3
and it worked for me. Follow below what I used:
$ionicPopup.confirm({
title: titulo,
subTitle: subtitle,
template:
`<style>
.popup{
border-radius: 7px !important;
}
.popup-head {
background: ${backgroundTitulo} !important;
border-top-left-radius: 7px !important;
border-top-right-radius: 7px !important;
}
.popup-title {
color: ${corTitulo} !important;
}
.popup-sub-title{
color: ${corTitulo} !important;
font-weight: normal;
font-size: 12pt;
}
.popup-body{
background: ${background} !important;
/*color:#fff !important;
font-size:24px !important;*/
text-align: center;
}
.popup-buttons{
background: ${background} !important;
border-bottom-left-radius: 7px !important;
border-bottom-right-radius: 7px !important;
}
.popup-buttons .button {
color: ${corBotaoTexto} !important;
}
.popup-buttons .button {
background: ${corBotao} !important;
color: ${corBotaoTexto} !important;
box-shadow: none !important;
border-radius: 5px !important;
}
</style>
<p>${message}</p>
`
,buttons: [
{ // Array[Object] (optional). Buttons to place in the popup footer.
text: 'Não',
type: 'button-default',
onTap: function(e) {
if( cancelCallback != null){
cancelCallback(e);
}
return e;
}
},
{
text: 'Sim',
type: 'button-positive',
onTap: function(e) {
if(confirmCallback != null){
confirmCallback(e);
}
return e;
}
}
]
});
};
Note: what is inside ${...}
, which is the string interpolator of javascript ES2015, are javascript variables that I define in my code.