/* global angular */

angular.module('app')
.directive('extHref', function (platformInfo) {
	'use strict';

	return {
		restrict: 'A',
		link: link
	};

	function link(scope, element, attributes) {
		const url = attributes.extHref;
		if (platformInfo.isCordova) {
			element[0].onclick = onclick;
		} else {
			element[0].href = url;
		}

		function onclick() {
			window.open(url, '_system');
			return false;
		}
	}
});

/* global angular, require */

angular.module('app')
.directive('extHref', function (platformInfo) {
	'use strict';

	return {
		restrict: 'A',
		link: link
	};

	function link(scope, element, attributes) {

		const url = attributes.extHref;
		element[0].onclick = () => {
			if (platformInfo.isCordova) {
				window.open(url, '_system');
			} else {
				require('electron').shell.openExternal(url);
			}
			return false;
		};
	}
});

Clean up, and use electron functions to open urls
Clean up, and use electron functions to open urls
