Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
  <script src="https://cdn.rawgit.com/a8m/angular-filter/master/dist/angular-filter.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body ng-app="app" ng-controller="MainCtrl">
  
  <b>Example1:</b>
  <p ng-repeat="item in items 
                | toArray: true 
                | pick: 'secId'">
    {{ item.$key }}, {{ item }}
  </p>
  
  <b>Example2:</b>
  <p ng-repeat="item in nestedItems 
                | toArray: true 
                | pick: 'secId || details.secId' ">
    {{ item.$key }}, {{ item }}
  </p>
  
</body>
</html>
 
angular.module('app', ['angular.filter'])
  .controller('MainCtrl', function($scope) {
  
  $scope.items = { 
    'A2F0C7':{ secId:'12345', pos:'a20' },
    'C8B3D1':{ pos:'b10' }
  };
  
  $scope.nestedItems = { 
    'A2F0C7':{
      details: { secId:'12345', pos:'a20' }
    },
    'C8B3D1':{
      details: { pos:'a20' }
    },
    'F5B3R1': { secId:'12345', pos:'a20' }
  };
  
  });
Output

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

Dismiss x
public
Bin info
a8mpro
0viewers