文章详情页
angular.js - AngularJs ng-repeat指令 如何取Json对象渲染到前端模板?
浏览:285日期: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; });});
下面是页面输出
请教我如何只取a.spd1name的值
问题解答
回答1:{{x}} 改成{{x.apd1name}}
相关文章:
1. angular.js - angular指令中的scope属性中用&获取父作用域函数的问题2. python的MySQLdb库中的executemany方法如何改变默认加上的单引号?3. mysql5.7就没有官方性质的详细配置文件吗?求大神告知4. python爬虫 - scrapy使用redis的时候,redis需要进行一些设置吗?5. 前端HTML与PHP+MySQL连接6. angular.js - angularjs ng-class指令改变ng-click点击的class属性失效7. angular.js - 如何控制ngrepeat输出的个数8. node.js - 问个问题 Uncaught (in promise)9. python 读取csv文件可以读取但内容错误,但单独用excel打开正常,如何解决?10. javascript - 关于ajax请求问题!
排行榜

网公网安备