title: Angular Javascript find method
body: <p>Here's my code:</p>
  
  <pre><code>   var myApp = angular.module('myApp',[]);
  
  //myApp.directive('myDirective', function() {});
  //myApp.factory('myService', function() {});
  
  myApp.controller('MyCtrl', ['$scope', MyCtrl]);
  
  function MyCtrl($scope) {
      $scope.name = 'Superhero';
  
      $scope.names = [
          {
              "name": "AAAAAA",
              "down": "False"
          },
          {
              "name": "BBBBBB",
              "down": "45%"
          },
          {
              "name": "CCCCC",
              "down": "12%"
          }
          ];
  
      $scope.datas = [
          {
              "data": "AAAAAA/45%"
          }
          ];
  
      $scope.getTheRightData = data =&gt; $scope.datas.map(d=&gt;d.data.split('/')[0]).find(d=&gt;d===data);
  }
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;div ng-controller="MyCtrl"&gt;
    &lt;table&gt;
          &lt;tbody&gt;
            &lt;tr ng-repeat="name in names"&gt;
              &lt;td&gt;{{name.name}}&lt;/td&gt;
              &lt;td&gt;{{name.down}}&lt;/td&gt;
              &lt;td ng-bind="getTheRightData(name.name)"&gt;&lt;/td&gt;
            &lt;/tr&gt;
           &lt;/tbody&gt;
    &lt;/table&gt;
  </code></pre>
  
  <p>What i do : one element from <code>$scope.datas</code> will match an element in <code>$scope.names</code>, but it only shows when <code>name.name</code> is the same. I need when <code>name.name</code> and <code>name.down</code> is the same, something like this : <code>&lt;td ng-bind="getTheRightData(name.name,name.down)"&gt;&lt;/td&gt;</code>, and in controller </p>
  
  <pre><code>$scope.getTheRightData = data =&gt; $scope.datas.map(d=&gt;d.data.split('/')[0][1]).find(d=&gt;d===data);
  }
  </code></pre>
  
  <p>, but it dont work.
  Thanks for answers and ideas for advance!</p>