All Downloads are FREE. Search and download functionalities are using the official Maven repository.

widgets.pbModalContainer.pbModalContainer.ctrl.js Maven / Gradle / Ivy

There is a newer version: 1.0.9
Show newest version
function PbModalContainerCtrl($scope, $log, $modal, modalService) {
    var ctrl = this;
    $scope.currentModal = this;    
    modalService.register($scope.properties.modalId, this);

    var modalInstances =[];
    ctrl.close = function(){
      if(modalInstances){
        modalInstances.pop().close();
      }else{
        console.log('No instance of modal to close');
      }
    }
    ctrl.open=function (){
         var modalInstance = $modal.open({
              scope: $scope,
              size: $scope.properties.size,
              animation: $scope.properties.animation,
              ariaLabelledBy: 'modal-title',
              ariaDescribedBy: 'modal-body',
              templateUrl: $scope.properties.modalId+'-modalContent.html',
              appendTo: undefined
             });
         modalInstances.push(modalInstance);
      }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy