Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

156
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda