文章详情页
angular.js - AngularJs ng-repeat指令 如何取Json对象渲染到前端模板?
浏览:109日期: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. sass - gem install compass 使用淘宝 Ruby 安装失败,出现 4042. javascript - js 对中文进行MD5加密和python结果不一样。3. mysql里的大表用mycat做水平拆分,是不是要先手动分好,再配置mycat4. window下mysql中文乱码怎么解决??5. 为啥不用HBuilder?6. python - (初学者)代码运行不起来,求指导,谢谢!7. javascript - h5上的手机号默认没有识别8. python - 获取到的数据生成新的mysql表9. python的文件读写问题?10. 为什么python中实例检查推荐使用isinstance而不是type?
排行榜
