search

Home  >  Q&A  >  body text

angular.js - AngularJs ng-repeat directive How to get the Json object and render it to the front-end template?

1. The Json object has been generated in the background and the js has been obtained. I don’t know how to obtain the front-end ng-repeat


The following is the front-end code

<p ng-repeat="x in data track by $index">
<td>{{x}}</td>
</p>

The following is the js code

var app = angular.module('ngApp', []);

app.controller('productPackagePullController', function ($scope,$http) {

     $http.get('?/vProduct/getSpecsDistinct/',{params: {id: 8147}})
  .success(function (data) {
          $scope.data = data;
  });

});

The following is the page output

Please teach me how to get only the value of a.spd1name

PHP中文网PHP中文网2792 days ago606

reply all(1)I'll reply

  • PHPz

    PHPz2017-05-15 17:06:03

    {{x}} changed to {{x.apd1name}}

    reply
    0
  • Cancelreply