Angularjs引导模式

时间:2017-10-07 01:56:34

标签: javascript angularjs angular-ui-bootstrap multi-select

我是Angularjs的新手,所以我首先对这个问题感到抱歉。

我正在使用来自https://angular-ui.github.io/bootstrap/

的Angular bootstrap模态

以及来自https://codepen.io/long2know/pen/PqLRyZ

的多选下拉列表

我不知道如何一起使用它们。

我有一个模块和控制器:

var app = angular.module("opsApp", ["$jsOps", "ngAnimate", "ngSanitize", "ui.bootstrap"]);
app.controller("OpsLayoutController", function ($uibModal, $log, $document, $scope, $http, jsPlumbService) {
this.renderParams = {
        view: {
            processes: {
                "default": {
                    template: "process",
                    events: {
                        tap: function (params) {
                            var modalInstance = $uibModal.open({
                                animation: $scope.animationsEnabled,
                                ariaLabelledBy: "modal-title",
                                ariaDescribedBy: "modal-body",
                                templateUrl: "editNodeModal.html",
                                controller: "ProcessModalInstanceCtrl",
                                controllerAs: "$ctrlProcess",
                                size: "lg",
                                appendTo: undefined,
                                resolve: {
                                    process: function () {
                                        return params.process.data;
                                    }
                                }
                            });

                            modalInstance.result.then(function (process) {

                            }, function () {
                                $log.info("Modal dismissed at: " + new Date());
                            });
                        }
                    }
                }
            }
}
app.controller("ProcessModalInstanceCtrl", function ($uibModalInstance, process) {

    $ctrlProcess.process= process;

    $ctrlProcess.ok = function () {
        $uibModalInstance.close(process);
    };

    $ctrlProcess.cancel = function () {
        $uibModalInstance.dismiss("cancel");
    };
});

这意味着我点击(点击)元素然后打开模态。 这不是我的全部代码。

任何人都可以建议我如何使用模态中的下拉列表。

非常感谢你。

1 个答案:

答案 0 :(得分:2)

Angular Material无论如何都提供了多选功能。

enter image description here

链接:https://material.angularjs.org/latest/demo/select

设计更简单,更和谐。您也可以使用其他UI元素来保持界面一致性。