Every time the user searches for the CPF, a connection with the server will be established, even if it is a CPF already searched and this is unnecessary, because this information can be saved on the client side.
What I suggest in the code below is that the CPF is included as index of the array contratos, what makes sense why currently each object within the array contratos refers to a CPF and it is precisely the duplication that you want to avoid:
$scope.contratos = [];
$scope.Pesquisar = function(){
   //verifica se o CPF é um índice do array contratos 
   //e só faz um novo request se o CPF ainda não foi pesquisado.
   if(typeof $scope.contratos[cpf] === 'undefined') {
       $http.post('php/GetContratosProtocolo.php', {
          'cpf':cpf
       })
       .success(function(data){
          if(typeof data == 'object'){  
              //adiciona um novo elemento ao array utilizando o CPF como índice.
              $scope.contratos[cpf] = data;
          }else{
              //adiciona na mesma o CPF no array de contratos, embora o resultado seja `null`, não deixa de ser uma resposta válida.
              $scope.contratos[cpf] = null;
              showerror('Contrato Não Encontrado')
          }
       })
       .error(function(data){
           console.log(data)
       })
   }
};
Then to extract the data from the array contratos just make a forEach:
$scope.contratos.forEach(function(value, key) {
     //key = cpf utilizado como índice
     //...
});
							
							
						 
More details.. what contains
data[i]?– MoshMage
for example... name:Luiz | Cpf: 111.111.111-11| id: 1
– Luiz Fábio
i’m doing this for, because date can come with 2 objects, so I play the date[0], date[1] inside the array, and I’m doing a push because the user will assemble a list, so as he goes searching for Cpf, he will insert in the list
– Luiz Fábio
Luiz: This code is insufficient for us to help you :)
– MoshMage
I’ll try to rephrase my question
– Luiz Fábio