如何在 Angular UI Bootstrap 中增加模态宽度? [英] How do I increase modal width in Angular UI Bootstrap?

查看:29
本文介绍了如何在 Angular UI Bootstrap 中增加模态宽度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个模态:

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

有没有办法增加它的宽度?

is there a way to increase its width?

推荐答案

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

I use a css class like so to target the modal-dialog class:

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

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

Then in the controller calling the modal window, set the 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;
            });
    };

这篇关于如何在 Angular UI Bootstrap 中增加模态宽度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆