Używam $ ionicPopup.confirm(), ale chciałbym zmienić tekst "Anuluj przycisk". Czy to możliwe?
Jestem świadomy .Show() składnia:
buttons: [
{ text: 'Cancel' }
]
Ale to nie wydają się działać z .Przyciskiem() ...
Thank 4 pomoc
Używam $ ionicPopup.confirm(), ale chciałbym zmienić tekst "Anuluj przycisk". Czy to możliwe?
Jestem świadomy .Show() składnia:
buttons: [
{ text: 'Cancel' }
]
Ale to nie wydają się działać z .Przyciskiem() ...
Thank 4 pomoc
UPDATE: na jonowej 1.0.0, jest to obecnie możliwe (http://ionicframework.com/docs/api/service/ $ ionicPopup /)
showConfirm Opcje:
{
title: '', // String. The title of the popup.
cssClass: '', // String, The custom CSS class name
subTitle: '', // String (optional). The sub-title of the popup.
template: '', // String (optional). The html template to place in the popup body.
templateUrl: '', // String (optional). The URL of an html template to place in the popup body.
cancelText: '', // String (default: 'Cancel'). The text of the Cancel button.
cancelType: '', // String (default: 'button-default'). The type of the Cancel button.
okText: '', // String (default: 'OK'). The text of the OK button.
okType: '', // String (default: 'button-positive'). The type of the OK button.
}
Tak można zrobić każdej pojemności chcesz, używając jonową popup.show i powiązać zdarzenie Anuluj.
$ionicPopup.show({
template: msg,
title: titleConfirm,
buttons: [
{ text: "BTN_NO",
onTap:function(e){
return false;
}
},
{ text: "BTN_OK",
onTap:function(e){
return true;
}
},
]
});
Po przeprowadzeniu dochodzenia w sprawie tego ionic popover.confirm function jest nie można go dostosować. Wartość popover.confirm są sztywno linia 446
function showConfirm(opts) {
return showPopup(extend({
buttons: [{
text: opts.cancelText || 'Cancel',
type: opts.cancelType || 'button-default',
onTap: function() { return false; }
}, {
text: opts.okText || 'OK',
type: opts.okType || 'button-positive',
onTap: function() { return true; }
}]
}, opts || {}));
}
Jest to możliwe do zrobienia, trzeba użyć "typ" rzeczy wewnątrz przycisku
buttons: [
{ text: 'Cancel' },
{
text: '<b>Save</b>',
type: 'button-assertive',
onTap: function(e) {
$scope.request_form.abc = "accepted";
}
}
]
w typu części, którą muszą nadać klasie nazwę klasy i można zmienić kolor przycisku przycisku.
Przynajmniej w najnowszej wersji 1.0.0 (jonowej) można wykonać następujące czynności:
var confirmPopup = $ionicPopup.confirm({
title: 'Popup title',
template: 'Popup text',
cancelText: 'Custom cancel',
okText: 'Custom ok'
}).then(function(res) {
if (res) {
console.log('confirmed');
}
});
Opener poprosił o sposób dostosowania tekstu przycisku, a nie kolorów. – baxeico