Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

2 modal in one controller

$
0
0

@sefasaid wrote:

Hello
I use 2 modal in my controller. I do it for another controller but now i can't do it. here is my code
`$ionicModal.fromTemplateUrl('templates/imagemodal.html', {
scope: $scope,
animation: 'slide-in-up'
}).then(function(modal) {
$scope.modal = modal;
});

$scope.openModal = function() {
  $ionicSlideBoxDelegate.slide(0);
  $scope.modal.show();
};

$scope.closeModal = function() {
  $scope.modal.hide();
};



$ionicModal.fromTemplateUrl('templates/profile/changepic.html', {
  scope: $scope,
  animation: 'slide-in-up'
}).then(function(modal2) {
  $scope.changepicim = modal2;
});
// Cleanup the modal when we're done with it!


$scope.openprof = function() {

  $scope.changepicim.show();
};

$scope.closeprof = function() {
  $scope.changepicim.hide();
};`

when i use $scope.openprof() console log is
Error: undefined is not an object (evaluating '$scope.changepicim.show')

where i'm wrong?
sorry for bad english.

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>