<commit_before>###
model = [{label: label1, value: value1, selected: true|false}, {label: label2, value: value2, selected: true|false}...]

<fancy-select template-url="../select.html" ng-model="model" multiple title="choose countries">
</fancy-select>
###
selectDir = ($ionicModal) ->
	restrict:	'E'
	
	scope:
		model:	'=ngModel'
			
	replace:	true
	
	templateUrl: (element, attrs) ->
		attrs.templateUrl || '../select.html'
		
	link: (scope, element, attrs) ->
		_.extend scope, 
			multiple:	'multiple' of attrs && attrs.multiple != 'false'
			title:		attrs.title || 'Select'
			
		scope.selected = ->
			ret = _.map _.where(scope.model, selected: true), (item) ->
				item.value
			ret.join(", ")
			
		scope.click = (event) ->
			$ionicModal.fromTemplateUrl("fancy-select-items.html", scope: scope)
				.then (modal) ->
					scope.modal = modal
					scope.close = ->
						scope.$emit 'selected', _.map _.where(scope.model, selected: true), (item) ->
							item.value 
						modal.remove()
					scope.select = (item) ->
						if not scope.multiple
							_.each scope.model, (item) ->
								_.extend item, selected: false
							item.selected = true
							scope.close()
					modal.show()
					
angular.module('ngFancySelect', ['ionic'])
	.directive 'fancySelect', ['$ionicModal', selectDir]<commit_msg>show selected label instead of value on drop down label<commit_after>###
model = [{label: label1, value: value1, selected: true|false}, {label: label2, value: value2, selected: true|false}...]

<fancy-select template-url="../select.html" ng-model="model" multiple title="choose countries">
</fancy-select>
###
selectDir = ($ionicModal) ->
	restrict:	'E'
	
	scope:
		model:	'=ngModel'
			
	replace:	true
	
	templateUrl: (element, attrs) ->
		attrs.templateUrl || '../select.html'
		
	link: (scope, element, attrs) ->
		_.extend scope, 
			multiple:	'multiple' of attrs && attrs.multiple != 'false'
			title:		attrs.title || 'Select'
			
		scope.selected = ->
			ret = _.map _.where(scope.model, selected: true), (item) ->
				item.label
			ret.join(", ")
			
		scope.click = (event) ->
			$ionicModal.fromTemplateUrl("fancy-select-items.html", scope: scope)
				.then (modal) ->
					scope.modal = modal
					scope.close = ->
						scope.$emit 'selected', _.map _.where(scope.model, selected: true), (item) ->
							item.value 
						modal.remove()
					scope.select = (item) ->
						if not scope.multiple
							_.each scope.model, (item) ->
								_.extend item, selected: false
							item.selected = true
							scope.close()
					modal.show()
					
angular.module('ngFancySelect', ['ionic'])
	.directive 'fancySelect', ['$ionicModal', selectDir]
{'fraction_non_alphanumeric': 0.17054845980465816, 'fraction_numerical': 0.003005259203606311, 'mean_word_length': 2.9984984984984986, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 29, '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': '3251575', 'n_tokens_mistral': 1065, 'n_tokens_neox': 856, 'n_words': 208}