'use strict';

app.directive('selectVariableType', function ($modal, $timeout) {
	return {
		restrict: 'A',
		scope: {
			system: '='
		},
		controller: function($scope, $element) {
			$scope.variableTypes = [{name:'True False', value:0}, {name:'String', value:1}, {name:'Integer', value:2}];
			$scope.newVar = {type:0};
			var modal = $modal({scope: $scope, title: 'New Variable Type', template: 'views/modal-tpls/select-variable-type.html', show: false});
			
			$element.on('click', function(event) {
				event.preventDefault();
				modal.$promise.then(modal.show);
			});
		}
	};
});