AngularJS 1.4

by Sajeetharan Sinnathurai

HTML

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.6/angular.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://cdn.rawgit.com/angular-ui/bootstrap-bower/0.13.4/ui-bootstrap-tpls.js"></script>
<body ng-app="myApp" ng-controller="ctrl">
  <table class="table table-hover tr-table transactions" style="width: 100%;">
    <thead>
      <tr class="search-row pending-orders table-header-row-height tr-table-head">
        <th>ID</th>
        <th>Bill Number</th>
        <th>Location</th>
        <th>Url</th>

      </tr>
    </thead>
    <tbody>
      <tr ng-repeat="todolist in todolists">
         <td ng-repeat="list in todolist"> {{list + ($last ? "" : ", ") }}</td> 
        <td>{{todolist.bill_number}}</td>
        <td>{{todolist.location}}</td>
        <td><a target="_blank" href="{{ 'http://' + todolist.url}}">Download Invoice : <i title="Download Invoice" style="padding-left:5px;cursor:pointer;color:black;" class="fa fa-download"></i></a> </td>

      </tr>
    </tbody>
  </table>
</body>

JavaScript

angular
      .module('myApp', [])
       
      
      .controller('ctrl', function($scope) {
        $scope.todolists = [{
          "id": "id_584",
          "customer_id": 2,
          "url": "url",
          "bill_number": "123",
          "location": "from_location"
        }, {
          "id": "id_122",
          "customer_id": 3,
          "url": "url",
          "bill_number": "123",
          "location": "from_location"
        }, {
          "id": "id_128",
          "customer_id": 4,
          "url": "url",
          "bill_number": "123",
          "location": "from_location"
        }, {
          "id": "id_805",
          "customer_id": 5,
          "url": "url",
          "bill_number": "123",
          "location": "from_location"
        }, {
          "id": "id_588",
          "customer_id": 6,
          "url": "url",
          "bill_number": "123",
          "location": "from_location"
        }, {
          "id": ["id_115", " id_114"],
          "customer_id": 7,
          "url": "url",
          "bill_number": "123",
          "location": "from_location"
        }]

      });