<commit_before>'use strict';

// Calldetails controller
angular.module('calldetails').controller('CalldetailsController', ['$scope', '$stateParams', '$location', 'Authentication', 'Calldetails',
	function($scope, $stateParams, $location, Authentication, Calldetails) {
		$scope.authentication = Authentication;

		// Create new Calldetail
		$scope.create = function() {
			// Create new Calldetail object
			var calldetail = new Calldetails ({
				name: this.name
			});

			// Redirect after save
			calldetail.$save(function(response) {
				$location.path('calldetails/' + response._id);

				// Clear form fields
				$scope.name = '';
			}, function(errorResponse) {
				$scope.error = errorResponse.data.message;
			});
		};

    $scope.gotoStores = function (calldetail){
      console.log(calldetail)
      $location.path(calldetail.url +"/"+ calldetail.store._id +"/edit");
    };

		// Remove existing Calldetail
		$scope.remove = function(calldetail) {
			if ( calldetail ) { 
				calldetail.$remove();

				for (var i in $scope.calldetails) {
					if ($scope.calldetails [i] === calldetail) {
						$scope.calldetails.splice(i, 1);
					}
				}
			} else {
				$scope.calldetail.$remove(function() {
					$location.path('calldetails');
				});
			}
		};

		// Update existing Calldetail
		$scope.update = function() {
			var calldetail = $scope.calldetail;

			calldetail.$update(function() {
				$location.path('calldetails/' + calldetail._id);
			}, function(errorResponse) {
				$scope.error = errorResponse.data.message;
			});
		};<commit_msg>added files<commit_after>'use strict';

// Calldetails controller
angular.module('calldetails').controller('CalldetailsController', ['$scope', '$stateParams', '$location', 'Authentication', 'Calldetails',
	function($scope, $stateParams, $location, Authentication, Calldetails) {
		$scope.authentication = Authentication;

		// Create new Calldetail
		$scope.create = function() {
			// Create new Calldetail object
			var calldetail = new Calldetails ({
				name: this.name
			});

			// Redirect after save
			calldetail.$save(function(response) {
				$location.path('calldetails/' + response._id);

				// Clear form fields
				$scope.name = '';
			}, function(errorResponse) {
				$scope.error = errorResponse.data.message;
			});
		};

    $scope.gotoStores = function (calldetail){
      console.log(calldetail.url)
      console.log(calldetail.store._id)
      $location.path(calldetail.url +"/"+ calldetail.store._id +"/edit");
    };

		// Remove existing Calldetail
		$scope.remove = function(calldetail) {
			if ( calldetail ) { 
				calldetail.$remove();

				for (var i in $scope.calldetails) {
					if ($scope.calldetails [i] === calldetail) {
						$scope.calldetails.splice(i, 1);
					}
				}
			} else {
				$scope.calldetail.$remove(function() {
					$location.path('calldetails');
				});
			}
		};

		// Update existing Calldetail
		$scope.update = function() {
			var calldetail = $scope.calldetail;

			calldetail.$update(function() {
				$location.path('calldetails/' + calldetail._id);
			}, function(errorResponse) {
				$scope.error = errorResponse.data.message;
			});
		};
{'fraction_non_alphanumeric': 0.15769474350854973, 'fraction_numerical': 0.0006333122229259025, 'mean_word_length': 3.381414701803051, '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': '6988942', 'n_tokens_mistral': 1269, 'n_tokens_neox': 1064, 'n_words': 178}