Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <script src="https://cdn.firebase.com/js/client/2.0.2/firebase.js"></script>
  <script src="https://rawgit.com/angular/bower-angular/master/angular.min.js">  </script>
  <script src="https://cdn.firebase.com/libs/angularfire/1.1.2/angularfire.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
  
<body ng-app="app">
  
  <div ng-controller="InvoiceCtrl">
    
    <table>
      <tr ng-repeat="invoice in invoices">
       <td>
         <a ng-href="#/invoices/details/{{invoice.$id}}/{{client.$id}}">
            {{invoice.$id}}
         </a>
       </td>
      </tr>
    </table>
    
  </div>
  
</body>
  
</html>
 
angular
  .module('app', [
    'firebase'
  ])
  .constant('FBURL', 'https://invoice-pro-5000.firebaseio-demo.com')
  .factory('clients', clients)
  .factory('invoices', invoices)
  .controller('InvoiceCtrl', InvoiceController);
function clients(FBURL, $firebaseObject) {
  return function(clientId) {
    var ref = new Firebase(FBURL).child('clients').child(clientId);
    return $firebaseObject(ref);
  };
}
function invoices(FBURL, $firebaseArray) {
  return function(clientId) {
    var ref = new Firebase(FBURL).child('clientInvoices').child(clientId);
    return $firebaseArray(ref);
  };
}
function InvoiceController($scope, clients, invoices) {
  
  var fakeRouteParam = 1;
  
  $scope.client = clients(fakeRouteParam);
  $scope.invoices = invoices(fakeRouteParam);
  
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers