【发布时间】:2015-05-07 03:18:09
【问题描述】:
我有一个从另一个模式 (nbr 2) 打开的模式 (nbr 1)。模态 nbr 1 工作正常,并显示了它应该显示的东西。但是我试图输入一个输入来过滤模态中的项目,但是输入不起作用。我不能在里面写任何东西,它只是不接受我的输入。
我认为这与它是我的第二个模式有关,因为当我从“根”打开它(而不是从另一个模式打开它)时,文本输入工作正常。
这是我的html:
<div class="modal-header">
<h3 class="modal-title">Pick a student</h3>
<div class="modal-body">
<!-- I can't type in this text field, no matter where it's placed och if it has any attributes at all -->
<input type="text" class="form-control" id="searchUsers" placeholder="Search by name, personal ID number or group" ng-model="search.$" ng-click="console.log('omg')">
<table class="table table-hover table-striped equi-table">
<tbody>
<tr ng-repeat="user in state.users | filter:search:strict">
<td>{{ user.firstName }}</td>
<td>{{ user.lastName }}</td>
<td>{{ user.personalIDNumber }}</td>
</tr>
</tbody>
</table>
</div>
这是 JavaScript:
这部分从模态 nbr 2 中打开模态:
$scope.addUserToCourse = function () {
utilities.pickAUserModal();
};
这是实际的模态
angular.module('equiclass.services')
.factory('utilities', function ($modal) {
var pickAUserModal = function () {
var modalInstance = $modal.open({
templateUrl: '/views/modals/pick-a-user-modal.html',
controller: function ($scope, $modalInstance, stateService, userService) {
var log = loggingService.getLogger ('pickAUserModal');
$scope.state = userService.state;
userService.initializeUsers().then(function () {
$scope.hasInitialized = true;
});
$scope.ok = function () {
$modalInstance.close(true);
};
$scope.cancel = function () {
$modalInstance.close(false);
};
}
});
};
return {
pickAUserModal: pickAUserModal
};
});
为什么我不能在我的文本输入中输入任何内容?我尝试编辑 z-indexes,并在那里放置不同类型的输入(复选框有效,textareas 无效)。正如我之前所说,模态是从另一个模态打开的,但是第二个模态不是使用 Angular UI Bootstrap 创建的(我正在慢慢过渡到 Angular UI)
【问题讨论】:
-
您是否在开发者工具中检查了输入确实被禁用了?或者它可能是第一个模态的叠加层?
-
我认为它没有被覆盖,因为所有其他按钮等都可以工作。我已阅读文档,但找不到任何内容!
-
你能在 jsfiddle 或 plnkr 上做一个工作示例吗?
标签: angularjs twitter-bootstrap angular-ui-bootstrap