Wie rufe ich openAddCardModal()
in ModalController
von PopupController
an?Offenes ionisches Modal von ionischem Popup
function PopupController($scope, $ionicPopup, $timeout, $state) {
$scope.showPaymentOptionsPopup = function() {
$ionicPopup.confirm({
title: 'Payment Options',
cssClass: 'popup-vertical-buttons',
buttons:[
{
text: "Add",
type: 'button-positive',
onTap: function(){
// call openAddCardModal();
}
},
{
text: "Edit",
type: 'button-positive',
onTap: function(){
}
},
{
text: "Close",
type: 'button-dark',
onTap: function(){
}
}
]
});
};
}
function ModalController($scope, $ionicModal, $stateParams) {
// addCardModal()
$ionicModal.fromTemplateUrl('views/payment-add-card.view.html', {
scope: $scope,
animation: 'slide-in-up'
}).then(function(modal) {
$scope.addCardModal = modal;
})
$scope.openAddCardModal = function() {
$scope.addCardModal.show()
}
$scope.closeAddCardModal = function() {
$scope.addCardModal.hide();
};
$scope.$on('$destroy', function() {
$scope.addCardModal.remove();
}
Was ist die Beziehung zwischen PopupController und ModalController? – dfsq
'showEditImagePopup()' wird in der Ansicht mit '' aufgerufen. Es ist ein Popup (http://ionicframework.com/docs/api/service/$ionicPopup/). Ich möchte ein Modal (http://ionicframework.com/docs/api/service/$ionicModal/) aus dem Popup aufrufen, wenn der Benutzer auf die Schaltfläche Bearbeiten klickt. Bild für Klarheit: http://imgur.com/m6vId0d – methuselah
@dfsq kommt keine andere Beziehung in den Sinn – methuselah