如何使用Angular-ui解析另一个模态中的模态?

时间:2015-11-12 18:32:55

标签: javascript jquery angularjs twitter-bootstrap

我使用angular-ui模态指令http://angular-ui.github.io/bootstrap/

我想打电话给另一个模式' openEditModal'从我的openAsideModal',我怎样才能做到这一点?

$scope.openAsideModal = function(){
  if($scope.asideInstance){
    $scope.asideInstance.close();
    delete $scope.asideInstance;
  }else{

    $scope.asideInstance = $aside.open({
      templateUrl: asideTemplateUrl,
      backdrop: false,
      controller: function($scope, $modalInstance, userEvents, openEditModal) {
        $scope.events = userEvents;
        $scope.openEditModal = function(e) {
          console.log(e);
        };
        $scope.ok = function(e) {
          $modalInstance.close();
          e.stopPropagation();
        };
        $scope.cancel = function(e) {
          $modalInstance.dismiss();
          e.stopPropagation();
        };
      },
      placement: 'right',
      size: 'sm',
      resolve:{
          userEvents: function() {
            // Return current user tasks
            return $filter('filter')($scope.events, {resourceId: currentUserId});
          },
          openEditModal: function() {
            return $scope.openEditModal;
          },
      }
    });
  }

0 个答案:

没有答案