<commit_before>function $MbModalProvider () {
	var defaults = this.defaults = {};

	function $MbModalFactory (MbComponent, $compile, $templateCache, $animate, $rootScope) {
		var bodyEl = angular.element(document.body);

		return function (options) {
			var $mbModal = {};

			$mbModal.options = options = angular.extend({}, defaults, options);

			if(angular.isUndefined(options.scope)) {
				options.scope = $rootScope.$new();
			}

			var scope = options.scope = options.scope.$new();
			var component = options.component = $mbModal.component = new MbComponent();

			angular.forEach(['show', 'hide', 'toggle'], function (key) {
				$mbModal[key] = function () {
					return component[key]();
				};
			});

			// Create the element
			// using provided
			// template/templateUrl
			if(angular.isDefined(options.templateUrl)) {
				options.template = $templateCache.get(options.templateUrl);
			}

			var el = options.el = angular.element(options.template);

			var modalLink = $mbModal.modalLink = $compile(el.contents());

			component.on('visibleChangeStart', function () {
				modalLink(scope);
			});

			$animate.enter(el, bodyEl);

			component.setElement(el);

			return $mbModal;
		};
	}

	this.$get = $MbModalFactory;
}

angular.module('mobie.components.modal', [
	'mobie.core.component'
])
.provider('$mbModal', $MbModalProvider);<commit_msg>mobie/components/modal: firing the visibleChangeStart event just once, for we do not need to recompile everything everytime the user decide to show the component<commit_after>function $MbModalProvider () {
	var defaults = this.defaults = {};

	function $MbModalFactory (MbComponent, $compile, $templateCache, $animate, $rootScope) {
		var bodyEl = angular.element(document.body);

		return function (options) {
			var $mbModal = {};

			$mbModal.options = options = angular.extend({}, defaults, options);

			if(angular.isUndefined(options.scope)) {
				options.scope = $rootScope.$new();
			}

			var scope = options.scope = options.scope.$new();
			var component = options.component = $mbModal.component = new MbComponent();

			angular.forEach(['show', 'hide', 'toggle'], function (key) {
				$mbModal[key] = function () {
					return component[key]();
				};
			});

			// Create the element
			// using provided
			// template/templateUrl
			if(angular.isDefined(options.templateUrl)) {
				options.template = $templateCache.get(options.templateUrl);
			}

			var el = options.el = angular.element(options.template);

			var modalLink = $mbModal.modalLink = $compile(el.contents());

			component.once('visibleChangeStart', function () {
				modalLink(scope);
			});

			$animate.enter(el, bodyEl);

			component.setElement(el);

			return $mbModal;
		};
	}

	this.$get = $MbModalFactory;
}

angular.module('mobie.components.modal', [
	'mobie.core.component'
])
.provider('$mbModal', $MbModalProvider);
{'fraction_non_alphanumeric': 0.15363128491620112, 'fraction_numerical': 0.0, 'mean_word_length': 3.982608695652174, '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': '234129', 'n_tokens_mistral': 1020, 'n_tokens_neox': 851, 'n_words': 177}