<commit_before>var shoppingControllers = angular.module('shoppingControllers', []);
var uid = 0;

shoppingControllers.controller('ListController', function($scope) {
   $scope.lists = [];
   $scope.addList=function(){
	 $scope.lists.push($scope.newList);
   $scope.lists = productFactory.getLists();

   }

});
shoppingControllers.factory('productFactory',function(){
  var products=[];
  var newProduct=[];
  var factory={};
   factory.getProducts=function(){
    return products;
  }
  return factory;

});
shoppingControllers.factory('listFactory',function(){
  var lists=[];
  var factory2={};
   factory.getLists=function(){
    return lists;
  }
  return factory2;

});


shoppingControllers.controller('ProductController', function($window,$scope,productFactory) {
  $scope.addProduct=function(){
    if($scope.newProduct.name===null){
       $window.alert('Numele produsului este obligatoriu!');      
    }else{
      if($scope.newProduct.id===null){
        $scope.newProduct.checked=false;
        $scope.newProduct.id=uid++;
        $scope.products.push($scope.newProduct);
      }else{
        for(i in $scope.products){
          if($scope.products[i].id===$scope.newProduct.id){
            $scope.products[i]=$scope.newProduct;
          };
        };
      };
     $scope.newProduct={};
    }
  };

  $scope.editProduct=function(id){
    for(i in $scope.products){
      if ($scope.products[i].id===id) {

      $scope.newProduct=angular.copy($scope.products[i]);
      };
    };
  };
  $scope.removeProduct=function(){

    i=$scope.products.length;
    while(i--){
      if ($scope.products[i].checked===true) {
        $scope.products.splice(i, 1);
      }
    }
  };
$scope.products = productFactory.getProducts();

  
});
<commit_msg>reparare addProduct<commit_after>var shoppingControllers = angular.module('shoppingControllers', []);
var uid = 0;

shoppingControllers.controller('ListController', function($scope) {
   $scope.lists = [];
   $scope.addList=function(){
         $scope.lists.push($scope.newList);
   $scope.lists = productFactory.getLists();

   }

});
shoppingControllers.factory('productFactory',function(){
  var products=[];
  var newProduct=[];
  var factory={};
   factory.getProducts=function(){
    return products;
  }
  return factory;

});
shoppingControllers.factory('listFactory',function(){
  var lists=[];
  var factory2={};
   factory.getLists=function(){
    return lists;
  }
  return factory2;

});


shoppingControllers.controller('ProductController', function($window,$scope,productFactory) {
  $scope.addProduct=function(){
    if($scope.newProduct.name==null){
       $window.alert('Numele produsului este obligatoriu!');
    }else{
      if($scope.newProduct.id==null){
        $scope.newProduct.checked=false;
        $scope.newProduct.id=uid++;
        $scope.products.push($scope.newProduct);
      }else{
        for(i in $scope.products){
          if($scope.products[i].id==$scope.newProduct.id){
            $scope.products[i]=$scope.newProduct;
          };
        };
      };
     $scope.newProduct={};
    }
  };

  $scope.editProduct=function(id){
    for(i in $scope.products){
      if ($scope.products[i].id===id) {

      $scope.newProduct=angular.copy($scope.products[i]);
      };
    };
  };
  $scope.removeProduct=function(){

    i=$scope.products.length;
    while(i--){
      if ($scope.products[i].checked===true) {
        $scope.products.splice(i, 1);
      }
    }
  };
$scope.products = productFactory.getProducts();

  
});
{'fraction_non_alphanumeric': 0.1755334281650071, 'fraction_numerical': 0.002275960170697013, 'mean_word_length': 3.3514851485148514, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1418759', 'n_tokens_mistral': 1125, 'n_tokens_neox': 1123, 'n_words': 143}