title: Angular search object array
body: <p>What is the best way to search a particular parameter of an object array in Angular?</p>
  
  <p>I populate my array from an Angular foreach :</p>
  
  <pre><code>  $scope.arrayiwanttosearch = [];
  
    angular.forEach(data, function(value, key) {
                          try{
                          var arrstring = new Array();
                          arrstring = value.img.split(',');
  
                              obj.name = value.name;
                              obj.selectedcolor = arrstring[0];
                              obj.colors = value.img;
                              obj.ischanging = false;
                              $scope.arrayiwanttosearch.push(obj);
                          }
                          catch(ex){
                          }  
                         })
  </code></pre>
  
  <p>I can only use array.index of when its an array without objects, is there a way to do this without using a for loop? Im trying to find the index of the object that has the obj.name == "test"</p>