文章详情页
angular.js - AngularJs ng-repeat指令 如何取Json对象渲染到前端模板?
浏览:317日期: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. 个人主页博客统计中的“进入博客”不能点击2. css3 - 微信前端页面遇到的transition过渡动画的bug3. Browser-sync安装失败问题4. 网页爬虫 - 关于Python的编码与解码问题5. php - 微信开发验证服务器有效性6. javascript - jquery选择的dom元素如何更新?7. sublime text 3不支持python的input吗8. python如何设置一个随着系统时间变化的动态变量?9. javascript - Webapp 关闭后重新打开无需登录如何操作?10. javascript - Ajax返回json格式之后的数据解析后取出来的数据为undefined?
排行榜

网公网安备