<commit_before>
/* global angular, console, StellarSdk */

angular.module('app')
.directive('accountName', function ($q, Reverse) {
	'use strict';

	function link(scope, element, attrs) {
		Reverse.lookupAndFill(
			function (res) {scope.name = res;},
			scope.id,
			scope.network,
			scope.tx
		);
	}

	return {
		restrict: 'E',
		scope: {
			id: '@',
			network: '@',
			tx: '='
		},
		link: link,
		template: '{{name}}'
	};
});
<commit_msg>Make account-name watch updates to “id”, and get network from the parent scope if not provided<commit_after>/* global angular */

angular.module('app')
.directive('accountName', function (Reverse) {
	'use strict';

	function link(scope, element, attributes) {

		scope.$watch('id', function () {

			if (scope.id === undefined) {
				return;
			}

			const network = scope.network || scope.$parent.network;
			Reverse.lookupAndFill(
				res => {
					element[0].innerText = res;
				},
				scope.id,
				network,
				scope.tx
			);
		});
	}

	return {
		restrict: 'E',
		scope: {
			id: '@',
			network: '@',
			tx: '='
		},
		link: link
	};
});

{'fraction_non_alphanumeric': 0.1798165137614679, 'fraction_numerical': 0.0009174311926605505, 'mean_word_length': 3.011029411764706, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '3499963', 'n_tokens_mistral': 460, 'n_tokens_neox': 382, 'n_words': 89}