Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

152
Views
en Angularjs JSON se devuelve pero no se muestra en la tabla

el código a continuación, crea una tabla de datos y funciona bien.

 ******************* 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; ********************************************************

Quiero hacer clic en una línea de la tabla y crear dinámicamente una segunda tabla con datos de carga. El siguiente código devuelve un archivo JSON correcto, que se muestra en la alarma, pero no se muestra en el html generado... se crea la tabla, pero solo se muestran los marcadores de posición JSON de angularjs: por ejemplo, {x.Charges}.

¿Alguien tiene alguna idea de por qué, por favor?

 //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'; //}) }) } ************************************************************************************ }) })

Muchas gracias

Robar

archivo JSON de carga de muestra

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!