我是 Angularjs 的新手,所以首先对这个问题感到抱歉。
我正在使用 Angular 引导模式,来自:https://angular-ui.github.io/bootstrap/
和多选下拉列表来自:https://codepen.io/long2know/pen/PqLRyZ
我不知道如何一起使用它们。
我有一个模块和 Controller :
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");
};
});
这意味着我单击(点击)元素然后打开模式。 这不是我的全部代码。
谁能建议我如何在模态中使用下拉列表。
非常感谢。
最佳答案
无论如何,Angular Material 提供了多选功能。
链接:https://material.angularjs.org/latest/demo/select
它更容易并且设计和谐。您也可以使用其他 UI 元素来保持界面的一致性。
关于javascript - 引导模式中的 Angularjs 多选下拉列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46615951/