<commit_before>angular.module('app')
  .directive('networkInterfaceSelector', function($compile, $templateCache) {
    var localHostInterface = {
      address: '127.0.0.1',
      name: 'localhost'
    };

    var templateUrl = '/js/directives/network-interface-selector.html';

    return {
      restrict: 'E',
      replace: true,
      templateUrl: templateUrl,
      link: function(scope, elem, attrs) {
        scope.interfaces = [];
        // scope.interfaces = [
        //   localHostInterface
        // ];

        chrome.system.network.getNetworkInterfaces(function(interfaces) {
          scope.interfaces = scope.interfaces.concat(interfaces);

          var el = $compile($templateCache.get(templateUrl)[1])(scope);
          elem.html('');
          elem.append(el[0]);
          console.log(scope, el[0].innerHTML);
        });
      }
    };
  });<commit_msg>Got the network-interface-selector directive showing the available interfaces.<commit_after>angular.module('app')
  .directive('networkInterfaceSelector', function($compile, $templateCache) {
    var localHostInterface = {
      address: '127.0.0.1',
      name: 'localhost'
    };

    var templateUrl = '/js/directives/network-interface-selector.html';

    return {
      restrict: 'E',
      replace: true,
      templateUrl: templateUrl,
      scope: null,
      controller: function($scope) {
        $scope.interfaces = [
          localHostInterface
        ];

        // TODO: Abstract this out to a service.
        chrome.system.network.getNetworkInterfaces(function(interfaces) {
          $scope.$apply(function() {
            $scope.interfaces = $scope.interfaces.concat(interfaces);
          });
        });
      }
    };
  });
{'fraction_non_alphanumeric': 0.13747099767981438, 'fraction_numerical': 0.008700696055684454, 'mean_word_length': 2.429423459244533, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '7048440', 'n_tokens_mistral': 494, 'n_tokens_neox': 480, 'n_words': 81}