Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- angular.module('myApp')
- .controller('BillDetail3Ctrl', function ($scope, billDetail3) {
- $scope.tableData = [];
- $scope.hourCount = 0;
- billDetail3.getMetList().then(function(data){
- var no = 0;
- for (var i = 0; i < data.length; i++) {
- for (var j = 0; j == data[0].d.currA.length; j++) {
- $scope.tableData.push({
- 'No': ++no,
- '_id': data[i]._id,
- 'hourtag': data[i].d.hourtag,
- 'currA': data[i].d.currA[j]
- });
- }
- }
- $scope.hourCount = no;
- }, function(){
- });
- });
- [
- {
- "_id": "100010001_20082015_0",
- "_rev": "8-e72619f2c6c05aac2e3692f1ea77eb0f",
- "d": {
- "uSN": "100010001",
- "timetag": 20082015,
- "hourtag": 0,
- "currA": {
- "0": 0,
- "1": 2,
- "2": 5,
- "3": 6,
- "4": 2.3
- },
- "currB": {
- "0": 10,
- "1": 23,
- "2": 52,
- "3": 61,
- "4": 12.3
- },
- "currABC": {
- "0": 0.1,
- "1": 2.2,
- "2": 5.2
- },
- <tr ng-repeat="pop in tableData">
- <td>{{pop.No}}</td>
- <td>{{pop._id}}</td>
- <td>{{pop.hourtag}}</td>
- <td>{{pop.currA}}</td> //This is doesn't work
- </tr>
- <tr ng-repeat="pop in tableData">
- <td>{{pop.No}}</td>
- <td>{{pop._id}}</td>
- <td>{{pop["d"].hourtag}}</td>
- <td>{{pop["d"].currA}}</td>
- </tr>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement