<commit_before>/// <reference path="../../../typings/angularjs/angular.d.ts" />
/// <reference path="../../../typings/angular-ui-router/angular-ui-router.d.ts" />
/// <reference path="../../app.common.ts" />

/**
 * This is fragment-directive which is used to embed arbitrary
 * fragments into the application.
 */
module Blog {
	export var AppFragmentDirective: angular.IDirectiveFactory = (Config: Common.Constants): angular.IDirective => {
		return {
			restrict: 'E',
			
			template: '<div>' + (Config.get<boolean>('ALLOW_ANGULAR_HTML', false) ?
				'<div bind-html-compile="vm.trustedValue"></div>' :
				'<div ng-bind-html="vm.trustedValue"></div>') + '</div>',
			
			controllerAs: 'vm',
			controller: 'FragmentController',
			
			replace: true,
			
			scope: {
				id: '@'
			}
		}
	}
	
	AppFragmentDirective.$inject = ['CONFIG'];
	angular.module('blogapp').directive('appFragment', AppFragmentDirective);
}
<commit_msg>Updated the Fragment-directive to always bind to the $rootScope<commit_after>/// <reference path="../../../typings/angularjs/angular.d.ts" />
/// <reference path="../../../typings/angular-ui-router/angular-ui-router.d.ts" />
/// <reference path="../../app.common.ts" />

/**
 * This is fragment-directive which is used to embed arbitrary
 * fragments into the application.
 */
module Blog {
	export var AppFragmentDirective: angular.IDirectiveFactory = (Config: Common.Constants): angular.IDirective => {
		return {
			restrict: 'E',
			
			template: '<div>' + (Config.get<boolean>('ALLOW_ANGULAR_HTML', false) ?
				'<div bind-html-compile="vm.trustedValue" bind-html-scope="$root"></div>' :
				'<div ng-bind-html="vm.trustedValue" bind-html-scope="$root"></div>') + '</div>',
			
			controllerAs: 'vm',
			controller: 'FragmentController',
			
			replace: true,
			
			scope: {
				id: '@'
			}
		}
	}
	
	AppFragmentDirective.$inject = ['CONFIG'];
	angular.module('blogapp').directive('appFragment', AppFragmentDirective);
}

{'fraction_non_alphanumeric': 0.19713993871297242, 'fraction_numerical': 0.0, 'mean_word_length': 3.4726027397260273, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 25, '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': '1679987', 'n_tokens_mistral': 691, 'n_tokens_neox': 609, 'n_words': 116}