<commit_before>'use strict';

angular.module('core').controller('itemController', ['$scope', 'Authentication', 'itemService',
	function($scope, Authentication, itemService) {
		// This provides Authentication context.
		$scope.authentication = Authentication;
	
	// Some example string - remove in prod
        $scope.helloText = 'Item Test';
        $scope.testuser = $scope.authentication.user.displayName;


    	$scope.items = itemService.query();
		$scope.newItem = '';

//	$scope.post = function() {
//		$scope.items.push($scope.newItem);
//		$scope.items.push({created_by: $scope.authentication.user.displayName, UPC: $scope.newItem, created_at: Date.now()}, 
//		function(){
//			$scope.items = itemService.query();
//			$scope.newItem = '';	
//		});
//	};

	$scope.post = function() {
	  $scope.newItem.created_by = $scope.authentication.user._id;
	  $scope.newItem.created_at = Date.now();
	  itemService.save($scope.newtItem, function(){
	    $scope.items = itemService.query();
	    $scope.newItem = '';
	  });
	};
	$scope.delete = function(item)	{
		itemService.delete({id: item._id});
		$scope.item = itemService.query();
	};

	}
]);<commit_msg>Update item.client.controller.js<commit_after>'use strict';

angular.module('core').controller('itemController', ['$scope', 'Authentication', 'itemService',
	function($scope, Authentication, itemService) {
		// This provides Authentication context.
		$scope.authentication = Authentication;
	
	// Some example string - remove in prod
        $scope.helloText = 'Item Test';
        $scope.testuser = $scope.authentication.user.displayName;


    	$scope.items = itemService.query();
		$scope.newItem = '';

//	$scope.post = function() {
//		$scope.items.push($scope.newItem);
//		$scope.items.push({created_by: $scope.authentication.user.displayName, UPC: $scope.newItem, created_at: Date.now()}, 
//		function(){
//			$scope.items = itemService.query();
//			$scope.newItem = '';	
//		});
//	};

	$scope.post = function() {
	  $scope.newItem.created_by = $scope.authentication.user._id;
	  $scope.newItem.created_at = Date.now();
	  $scope.newItem.UPC = $scope.newItem;
	  itemService.save($scope.newtItem, function(){
	    $scope.items = itemService.query();
	    $scope.newItem = '';
	  });
	};
	$scope.delete = function(item)	{
		itemService.delete({id: item._id});
		$scope.item = itemService.query();
	};

	}
]);
{'fraction_non_alphanumeric': 0.18763146823727386, 'fraction_numerical': 0.0, 'mean_word_length': 3.7751004016064256, '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': '3136650', 'n_tokens_mistral': 826, 'n_tokens_neox': 786, 'n_words': 121}