我遇到问题的专栏是" Alerta",我检查了日志并获取了所有数据,但只显示了" Sin Informacion"。
这就是我获取JSON数组数据的方式:
$http.get("conector.php?tipoDato=query3")
.then(function(response) {
$scope.mensajeEspera = "";
$scope.datos3 = response.data;
for(var i = 0; i < $scope.datos3.length; i++){
var currentObj = $scope.datos3[i];
currentObj.alertaObject = currentObj.alerta.split(';');
for (var j in currentObj.alertaObject) {
currentObj.alertaObject[j] = currentObj.alertaObject[j].replace(/\n/g,'').replace(/\r/g,'');
}
$scope.datosAlerta = currentObj.alertaObject;
console.log(currentObj.alertaObject);
}
$scope.datosAlerta = currentObj.alertaObject;
});
我在查询中查询了我的php查询coalesce(nullif(project_alert,''),'Sin Informacion') As alerta
我在HTML页面中获取数据:
<tr ng-repeat="z in datos3 ">
<td style="vertical-align: top;"><a href="#" ng-click="mostrar_proyecto(z.project_id)">{{z.proyecto}}</a></td>
<td style="vertical-align: top;">{{z.complejidad}}</td>
<td style="vertical-align: top;">{{z.glosa}}</td>
<td style="vertical-align: top;">{{z.inicio}}</td>
<td style="vertical-align: top;">{{z.termino}}</td>
<td style="vertical-align: top;">{{z.completado}}</td>
<td style="vertical-align: top;">{{z.estado}}</td>
<td style="vertical-align: top;">{{z.responsable}}</td>
<td style="vertical-align: top;">
<div class="hooveralerta">
<div ng-repeat="d in z.datosAlerta">
{{d}}
</div>
</div>
</td>