小编典典

如何在Angular UI Bootstrap中增加模式宽度?

angularjs

我正在创建一个模式:

var modal = $modal.open({
                    templateUrl: "/partials/welcome",
                    controller: "welcomeCtrl",
                    backdrop: "static",
                    scope: $scope,
                });

有没有办法增加其宽度?


阅读 219

收藏
2020-07-04

共1个答案

小编典典

我使用这样的css类来定位modal-dialog类:

.app-modal-window .modal-dialog {
  width: 500px;
}

然后在调用模式窗口的控制器中,设置windowClass:

    $scope.modalButtonClick = function () {
        var modalInstance = $modal.open({
            templateUrl: 'App/Views/modalView.html',
            controller: 'modalController',
            windowClass: 'app-modal-window'
        });
        modalInstance.result.then(
            //close
            function (result) {
                var a = result;
            },
            //dismiss
            function (result) {
                var a = result;
            });
    };
2020-07-04