【问题标题】:opening Mobile-Angular-ui modal dialog from controller从控制器打开 Mobile-Angular-ui 模式对话框
【发布时间】:2015-09-22 14:44:34
【问题描述】:

我在移动设备上使用 mobile-angular-ui。但我在从控制器打开对话框时遇到问题。

控制器

$scope.openModal = function() {
            SharedState.initialize($scope, 'modal1');
               // SharedState.turnOn('modal1');
            $rootScope.Ui.turnOn('modal1');
            var modalInstance = $modal.open({
                templateUrl: '../scripts/app/account/modal-dialog/modal.html',
                controller: 'SearchController', //This must be a referance, not a string
                size: 'sm'
            });
        }

查看

<a href ui-turn-on="modal1" ng-click="openModal()">link</a>

但我得到的是空的模态内容。

【问题讨论】:

    标签: angularjs


    【解决方案1】:

    尝试使用 $rootScope.Ui.turnOn('modal1') 代替 SharedState.turnOn('modal1');

    github-mobile-angular-ui/issues/252

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-30
      • 2011-09-07
      • 1970-01-01
      • 1970-01-01
      • 2013-03-07
      • 1970-01-01
      相关资源
      最近更新 更多