{"size": 1094, "ext": "js", "max_stars_repo_path": "public/js/angular-app/services/data/city-data-service.js", "max_stars_repo_name": "RealSaleem/BackOffice-LV8", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "public/js/angular-app/services/data/city-data-service.js", "max_issues_repo_name": "RealSaleem/BackOffice-LV8", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "public/js/angular-app/services/data/city-data-service.js", "max_forks_repo_name": "RealSaleem/BackOffice-LV8", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.3265306122, "max_line_length": 61, "alphanum_fraction": 0.5776965265}
(function(){
	'use strict';
	angular
	  .module('posApp')
	  .factory('cityDataService', cityDataService);

	  cityDataService.$inject = ['ajaxService', '$q'];

	  function cityDataService(ajaxService, $q){
	  	return {
	  		get_all_city : get_all_city,
	  		get_selected_cities : get_selected_cities,
	  	}

	  	function get_all_city(){
	  		var defered = $q.defer();
	  		ajaxService.get('/get_all_city', null)
	  			.then(function(response){
	  				if(!response.IsValid){
	  					defered.reject();
	  					return;
	  				};
	  				defered.resolve(response.Payload);
	  			})
	  			.catch(function(){
	  				defered.reject();
	  			});
	  			
	  		return defered.promise;
	  	}
	  	function get_selected_cities(country){
	  		var defered = $q.defer();
	  		ajaxService.get('/get_selected_city', {country:country})
	  			.then(function(response){
	  				if(!response.IsValid){
	  					defered.reject();
	  					return;
	  				};
	  				defered.resolve(response.Payload);
	  			})
	  			.catch(function(){
	  				defered.reject();
	  			});
	  			
	  		return defered.promise;
	  	}
	
	  }
})()