首先,我很抱歉,因爲我的英語。 我正在顯示一張表,表示它的數據來自服務器,並以角度重複顯示。 我做了一個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