<commit_before>'use strict';

angular.module('movieApp.search', [
	'ngRoute',
	'movieApp.search.controllers'
])
.config(['$routeProvider', function($routeProvider){
	 $routeProvider.when('/search/:movieName', {
      templateUrl: 'partials/movies.html', 
      controller: 'SearchCtrl'
    });
}]);

angular.module('movieApp.search.controllers', [
	'movieApp.search.services',
	'movieApp.favorites.services',
	'ngAnimate',
  	'iso.directives',
  	'movieApp.shared.directives'
]).controller('SearchCtrl', ['$scope', '$timeout', 'searchService', 'favoriteService',
	function($scope, $timeout, searchService, favoriteService) {
		searchService.getMovies().success(function(data) {
			$scope.results = data.results;
			$scope.total = data.total_results;
			$scope.orderProp = 'release_date';
		});

		$scope.addFavorite = function(fav) {
			fav.source = 'themoviedb';
			fav.favorite=true;
			favoriteService.addFavorite(fav);
		};
}]);

angular.module('movieApp.search.services', [
])
.factory('searchService', ['$http', '$routeParams', function($http, $routeParams) {
	return {
		getMovies : function() {
			return $http.get("https://api.themoviedb.org/3/search/movie?api_key=013eff1b8075d646416de6ec45620619&query=" + $routeParams.movieName);
		}
	};
}]);

angular.module('movieApp.shared.directives', [
])
.directive('currentItem', ['$timeout', function($timeout) {

function link(scope, element, attrs) {
    scope.$watch(attrs.currentItem, function(value) {
        if(value == scope.results.length) {
        	<!-- Fix to delay isotop until images are loaded -->
			$timeout(function() {
				console.log('Re-initiating isotope');
				scope.$emit('iso-init', {name: null, params: null});
			}, 500);
        }
    });

}

 return {
      link: link
    };

}]);<commit_msg>Fix for count in directive<commit_after>'use strict';

angular.module('movieApp.search', [
	'ngRoute',
	'movieApp.search.controllers'
])
.config(['$routeProvider', function($routeProvider){
	 $routeProvider.when('/search/:movieName', {
      templateUrl: 'partials/movies.html',
      controller: 'SearchCtrl'
    });
}]);

angular.module('movieApp.search.controllers', [
	'movieApp.search.services',
	'movieApp.favorites.services',
	'ngAnimate',
  	'iso.directives',
  	'movieApp.shared.directives'
]).controller('SearchCtrl', ['$scope', '$timeout', 'searchService', 'favoriteService',
	function($scope, $timeout, searchService, favoriteService) {
		searchService.getMovies().success(function(data) {
			$scope.results = data.results;
			$scope.total = data.total_results;
			$scope.orderProp = 'release_date';
		});

		$scope.addFavorite = function(fav) {
			fav.source = 'themoviedb';
			fav.favorite=true;
			favoriteService.addFavorite(fav);
		};
}]);

angular.module('movieApp.search.services', [
])
.factory('searchService', ['$http', '$routeParams', function($http, $routeParams) {
	return {
		getMovies : function() {
			return $http.get("https://api.themoviedb.org/3/search/movie?api_key=013eff1b8075d646416de6ec45620619&query=" + $routeParams.movieName);
		}
	};
}]);

angular.module('movieApp.shared.directives', [
])
.directive('currentItem', ['$timeout', function($timeout) {

function link(scope, element, attrs) {

	console.log("Chad");
    scope.$watch(attrs.currentItem, function(value) {
    	if(value == scope.results.length-1) {
        	<!-- Fix to delay isotop until images are loaded -->
			$timeout(function() {
				console.log('Re-initiating isotope');
				scope.$emit('iso-init', {name: null, params: null});
			}, 500);
        }
    });

}

 return {
      link: link
    };

}]);
{'fraction_non_alphanumeric': 0.18443080357142858, 'fraction_numerical': 0.015345982142857142, 'mean_word_length': 4.532407407407407, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '5955923', 'n_tokens_mistral': 1326, 'n_tokens_neox': 1196, 'n_words': 173}