您的位置:首頁技術文章
文章詳情頁

angular.js - AngularJs ng-repeat指令 如何取Json對象渲染到前端模板?

瀏覽:138日期:2024-09-30 13:13:59

問題描述

1.后臺已生成Json對象,js已經獲取,前端ng-repeat 不知如何獲取

下面是前端代碼

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

下面是js代碼

var app = angular.module(’ngApp’, []);app.controller(’productPackagePullController’, function ($scope,$http) { $http.get(’?/vProduct/getSpecsDistinct/’,{params: {id: 8147}}) .success(function (data) { $scope.data = data; });});

下面是頁面輸出angular.js - AngularJs ng-repeat指令 如何取Json對象渲染到前端模板?

請教我如何只取a.spd1name的值

問題解答

回答1:

{{x}} 改成{{x.apd1name}}

相關文章:
国产综合久久一区二区三区