title: Comparing objects inside array, do i use equals or indexOf -1?
body: <ol>
  <li><p>How can i check equality of arrays objects values (lets say, if im trying to add new date and time, which are same as old), when i have array named orderInfo, do i need to use 'indexOf' or 'angular.equals' method? </p></li>
  <li><p>How i do the checking from array, because these ones pass the if statement?</p>
  
  <pre><code> $scope.orderInfo = [{date: '11.11.2011', time: 8},
                   {date: '11.11.2005', time: 8}];
  </code></pre>
  
  <p>if ($scope.orderInfo.indexOf(time) === -1) {</p>
  
  <pre><code>     $scope.orderInfo.push({date: pvmr, time: aikas});
  
       $scope.errortextt = "info added";
  
  
       } else {
       $scope.errortextt = "already on list";
       }
  </code></pre></li>
  </ol>
  
  <p>or</p>
  
  <pre><code>$scope.containsObject = function (orderInfo, time) {
      var i;
      for (i = 0; i &lt; orderInfo.length; i++) {
          if (angular.equals(orderInfo[i], time)) {
  
  
              $scope.errortextt = "already on list";
              return true;
          }
      }
       $scope.orderInfo.push({date: pvmr, time: aikas});
  
           $scope.errortextt = "info added";
      return false;
  };
  </code></pre>