1

I'm using AngularJS and BootstrapUI for my modals and I need the possibility to open multiple modals at the same time, when I open a modal I need to put a button/link to open a secondone

Is there any way to do this?

1
  • You might reconsider this design... perhaps just close one and open another? Layering modals on top of each other is likely to lead to user frustration Commented Oct 15, 2014 at 17:13

1 Answer 1

4

May be I am missing smth, but there is not magic in modals: open modal = show some div with controller... The rest is done by css. http://plnkr.co/edit/GnadPfU9OFDFfyEa11vE?p=preview

modal in modal:

angular.module('ui.bootstrap.demo').controller('ModalInstanceCtrl', function ($scope, $modal, $modalInstance, items) {

  $scope.items = items;
  $scope.selected = {
    item: $scope.items[0]
  };

  $scope.open = function () {
    var modalInstance = $modal.open({
      templateUrl: 'myModalContent.html',
      controller: 'ModalInstanceCtrl',
      resolve: {
        items: function () {
          return $scope.items;
        }
      }
    });
  };

  $scope.ok = function () {
    $modalInstance.close($scope.selected.item);
  };

  $scope.cancel = function () {
    $modalInstance.dismiss('cancel');
  };
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.