文章詳情頁
angular.js - AngularJs ng-repeat指令 如何取Json對象渲染到前端模板?
瀏覽:155日期:2024-09-30 13:13:59
問題描述
1.后臺已生成Json對象,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; });});
下面是頁面輸出
請教我如何只取a.spd1name的值
問題解答
回答1:{{x}} 改成{{x.apd1name}}
相關(guān)文章:
1. mysql - AttributeError: ’module’ object has no attribute ’MatchType’2. php自學(xué)從哪里開始?3. javascript - 百度echarts series數(shù)據(jù)更新問題4. MySQL客戶端吃掉了SQL注解?5. 求大神幫我看看是哪里寫錯了 感謝細(xì)心解答6. javascript - JS設(shè)置Video視頻對象的currentTime時出現(xiàn)了問題,IE,Edge,火狐,都可以設(shè)置,反而chrom卻...7. javascript - 圖片能在網(wǎng)站顯示,但控制臺仍舊報錯403 (Forbidden)8. python小白的基礎(chǔ)問題 關(guān)于while循環(huán)的嵌套9. phpstady在win10上運行10. python - Django分頁和查詢參數(shù)的問題
排行榜

熱門標(biāo)簽