2 回答
TA贡献1876条经验 获得超7个赞
将table对象作为参数传递给openModal函数:
<button ng-click="openModal(table)">Select</button>
在openModal函数中使用它:
$scope.openModal = function (table) {
myFactory.defineModal().then(function (result) {
table.utype = result.utype;
table.minvalue = result.minvalue;
});
};
确保使用结果关闭模式:
$scope.ok = function () {
var result = {
utype: $scope.utype,
minvalue: $scope.minvalue,
};
$modalInstance.close(result);
};
请记住,模态被认为是破坏性的,并且被用户鄙视。
一般来说,干扰和分心会负面影响人类的表现,这是认知心理学中的一项常见发现。许多研究表明,分心极大地增加了在各种任务上的任务时间。
有关更多信息,请参见
虽然我没有收到任何错误,但是我没有得到返回的文本。
请确保为以下物品提供物品ng-repeat:
$scope.getData = function (selectedValue) {
//Commenting out the service part for now and hardcoding array
// service.getData(selectedValue).then(function (res) {
̶$̶s̶c̶o̶p̶e̶.̶t̶a̶b̶l̶e̶s̶ ̶=̶ ̶[̶'̶T̶a̶b̶l̶e̶1̶'̶,̶'̶T̶a̶b̶l̶e̶2̶'̶]̶;̶
$scope.tables = [
{name:'Table1',},
{name:'Table2',},
];
// });
};
TA贡献1998条经验 获得超6个赞
尝试将传递table给openModal模板中的
<button ng-click="openModal(table)"
现在,您可以将其用作openModal函数中的参考
$scope.openModal = function (table) {
// table === the clicked table
}
添加回答
举报
