文章详情页
angular.js - AngularJs ng-repeat指令 如何取Json对象渲染到前端模板?
问题描述
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. java - 当系统出现线程死锁时怎么处理?2. angular.js - 前端使用input使用ng-model绑定数据,控制前中一直无法得到映射的值3. angular.js - angularJS最简单方法实现点击checkbox,button变亮4. vue计算属性怎么样与for结合使用5. javascript - H5下拉能更换页面么 怎么实现 在左右滑的页面中6. angular.js - 关于指令link 中的创建变量问题7. javascript - 请问微信jssdk自定义分享是不是不能用了?8. html标签属性元素讲解9. javascript - setTimeout第一个参数是立即执行函数,看不懂了10. javascript - .vue页面跳转问题
排行榜