Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

154
Vistas
in Angularjs JSON is returned but not displayed in table

the code below, creates a table of data and works OK.

******************* works OK**************************

//angularjs to fetch JSON data for table

var app = angular.module('myApp', []);
app.controller('customersCtrl', function($scope, $http) {
$http.get("http://test2.aspx")
.then(function (response) {$scope.recds = response.data.records;

********************************************************

I want to click on a table line and dynamically create a second table with charge data. The code below returns a correct JSON file, which is displayed in the alarm, but does not display in the generated html.....the table is created but the angularjs JSON placeholders are just displayed: eg { x.Charges }.

Does anybody have any ideas why please?

//angularjs to fetch JSON data for charges
    $scope.go=function(x) {
        
        
            
                $http.get("http:///Charges.aspx?ac=" + x)
                .then(function (response) {$scope.chgs = response.data;
                
                alert(JSON.stringify($scope.chgs.records2));

*********************** Doesn't work************************************                    
                var lines='<table>';
                lines +='<tr>';
                lines +='<th>Account</th>';
                lines +='<th>Chargecode</th>';
                lines +='<th>Rate</th>';
                lines +='</tr>';
                lines +='<tr ng-repeat="x in chgs">';
                lines +='<td>{{ x.Customer }}</td>';
                lines +='<td>{{ x.ChargeCode }}</td>';
                lines +='<td>{{ x.Charge }}</td>';
                lines +='</tr>';
                lines +='</table>';
                document.getElementById("div1").innerHTML=lines;
                document.getElementById("div1").style.visibility = 'visible';
                //})
                })  
                        
    }
************************************************************************************
})
})

Many Thanks

Rob

sample charge JSON file

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda