首先,我很抱歉,因为我的英语。 我正在显示一张表,表示它的数据来自服务器,并以角度重复显示。 我做了一个ng表单,发送一个ajax请求的表的每一行,并得到另一个表,我想在另一个表中显示,直到现在所有的东西都是正确的,但我有一个小问题,我的问题是我必须在第一个表格的行上点击两次才能显示第二个表格数据,第一次所有数据都来自服务器,但没有显示在第二个表格中,我的角度代码如下所示。angularjs重复不会在第一时间显示数据
angular.module("BI", [])
.controller("ListTables", function ($scope, $http) {
$scope.ReportLst = [];
$scope.myData = {};
$scope.myData.ReportLst = [];
$scope.myData.ReportDetail = [];
$scope.myData.ReportDetail2 = [];
$scope.selectedReportval = "";
$scope.Load = function() {
$http.post('MakeReport.aspx/LoadReportLst', { data: {} })
.success(function (data) {
$scope.myData.ReportLst = JSON.parse(data.d);
})
.error(function (data, status) {
alert('error');
});
}
$scope.SelectRepID = function (val) {
$.ajax({
type: "POST",
url: "MakeReport.aspx/GetReportDetail",
contentType: "application/json; charset=utf-8",
data: "{ 'val': '" + val + "'}",
dataType: "json",
success: function (data) {
$scope.myData.ReportDetail = JSON.parse(data.d);
},
error: function (data, status, jqXHR) {
alert(data.d);
}
});
$scope.selectedReportval = val;
}
});
你能更新你的html代码吗? – Prasad