我正在尝试打开一个模态,我收到此错误
<button ng-click="openEmailModal()" class="btn btn-primary">Test Modal</button>
我打开模式,按下按钮就像这样
$scope.emailUsers = [];
$scope.example1data = [ {label: "David"}, {label:"Jhon"}, {label:"Danny"}];
$scope.openEmailModal = function() {
$modal.open({
templateUrl: 'app/main/notifications/views/details/modal.html',
windowClass: 'modal-danger',
resolve: {
emailUsers: function() {
return $scope.emailUsers;
},
exampe1data: function() {
return $scope.exampe1data;
}
}
});
}
这是我的js
<div class="modal-body">
<div ng-dropdown-multiselect="" options="example1data"
selected-model="emailUsers"></div>
</div>
这是modal.html中导致错误的html
options
我认为问题是模态无法访问selected-model
和emailUsers
中的那些变量,所以我在modal.open中添加了resolve成员,但是没有修复错误。如何解决此错误?
更新
我将js改为this,以便我知道我在返回变量之前初始化变量并且仍然得到错误。我还将下拉列表的数据更改为字符串数组。当我在chrome中调试时,它说exampe1data
是一个空数组,而 $scope.openEmailModal = function() {
$modal.open({
templateUrl: 'app/main/notifications/views/details/modal.html',
windowClass: 'modal-danger',
resolve: {
emailUsers: function() {
var emailUsers = [];
return emailUsers;
},
exampe1data: function() {
var exampe1data = ["David", "Jhon", "Danny"];
return exampe1data;
}
}
});
}
是一个字符串数组
open(‘datapickle’, ‘rb’) as f:
names, F, approximate = pickle.load(f)
答案 0 :(得分:2)
我认为问题是你的一些变量从:
开始返回一些东西,你可以检查一下这些函数的确切返回:
resolve: {
emailUsers: function() {
return $scope.emailUsers;
},
exampe1data: function() {
return $scope.exampe1data;
}
}
我预测您需要将其中一些返回转换为字符串。但是,让我们看看日志。
<强>更新强>
因此,我发现了您尝试使用的模块的问题。 Here is the link
简短回答如何修复它:
答案 1 :(得分:0)
由于@Mikki描述的问题,我最终使用了isteven multi select,除了:fff
resolve