Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2015
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. angular.module('myApp')
  2. .controller('BillDetail3Ctrl', function ($scope, billDetail3) {
  3.  
  4. $scope.tableData = [];
  5. $scope.hourCount = 0;
  6.  
  7. billDetail3.getMetList().then(function(data){
  8.  
  9. var no = 0;
  10. for (var i = 0; i < data.length; i++) {
  11. for (var j = 0; j == data[0].d.currA.length; j++) {
  12. $scope.tableData.push({
  13. 'No': ++no,
  14. '_id': data[i]._id,
  15. 'hourtag': data[i].d.hourtag,
  16. 'currA': data[i].d.currA[j]
  17. });
  18. }
  19. }
  20.  
  21. $scope.hourCount = no;
  22. }, function(){
  23.  
  24. });
  25. });
  26.  
  27. [
  28. {
  29. "_id": "100010001_20082015_0",
  30. "_rev": "8-e72619f2c6c05aac2e3692f1ea77eb0f",
  31. "d": {
  32. "uSN": "100010001",
  33. "timetag": 20082015,
  34. "hourtag": 0,
  35. "currA": {
  36. "0": 0,
  37. "1": 2,
  38. "2": 5,
  39. "3": 6,
  40. "4": 2.3
  41. },
  42. "currB": {
  43. "0": 10,
  44. "1": 23,
  45. "2": 52,
  46. "3": 61,
  47. "4": 12.3
  48. },
  49. "currABC": {
  50. "0": 0.1,
  51. "1": 2.2,
  52. "2": 5.2
  53. },
  54.  
  55. <tr ng-repeat="pop in tableData">
  56. <td>{{pop.No}}</td>
  57. <td>{{pop._id}}</td>
  58. <td>{{pop.hourtag}}</td>
  59. <td>{{pop.currA}}</td> //This is doesn't work
  60. </tr>
  61.  
  62. <tr ng-repeat="pop in tableData">
  63. <td>{{pop.No}}</td>
  64. <td>{{pop._id}}</td>
  65. <td>{{pop["d"].hourtag}}</td>
  66. <td>{{pop["d"].currA}}</td>
  67. </tr>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement