文章詳情頁
angular.js - AngularJs ng-repeat指令 如何取Json對象渲染到前端模板?
瀏覽:173日期: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. docker-machine添加一個已有的docker主機問題2. docker images顯示的鏡像過多,狗眼被亮瞎了,怎么辦?3. 關docker hub上有些鏡像的tag被標記““This image has vulnerabilities””4. css - 求推薦適用于vue2的框架 像bootstrap這種類型的5. Span標簽6. SessionNotFoundException:會話ID為null。調用quit()后使用WebDriver嗎?(硒)7. angular.js使用$resource服務把數據存入mongodb的問題。8. css - 關于div自適應問題,大家看圖吧,說不清9. redis啟動有問題?10. java - Collections類里的swap函數,源碼為什么要新定義一個final的List型變量l指向傳入的list?
排行榜
