widgets.pbModalContainer.pbModalContainer.ctrl.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ui-designer-artifact-builder-generator-angularjs Show documentation
Show all versions of ui-designer-artifact-builder-generator-angularjs Show documentation
This module is a generator on AngularJS for Artifact Builder
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);
}
}