文章詳情頁
angular.js - AngularJs ng-repeat指令 如何取Json對(duì)象渲染到前端模板?
瀏覽:165日期:2024-09-30 13:13:59
問題描述
1.后臺(tái)已生成Json對(duì)象,js已經(jīng)獲取,前端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; });});
下面是頁面輸出
請(qǐng)教我如何只取a.spd1name的值
問題解答
回答1:{{x}} 改成{{x.apd1name}}
相關(guān)文章:
1. docker鏡像push報(bào)錯(cuò)2. 關(guān)于nginx location配置的問題,root到底是什么3. angular.js - angular內(nèi)容過長展開收起效果4. angular.js - angularjs的自定義過濾器如何給文字加顏色?5. 關(guān)于docker下的nginx壓力測試6. python 怎樣用pickle保存類的實(shí)例?7. python2安裝失敗8. python的前景到底有大?如果不考慮數(shù)據(jù)挖掘,機(jī)器學(xué)習(xí)這塊?9. 并發(fā)模型 - python將進(jìn)程池放在裝飾器里為什么不生效也沒報(bào)錯(cuò)10. 大家好,請(qǐng)問在python腳本中怎么用virtualenv激活指定的環(huán)境?
排行榜

熱門標(biāo)簽