<commit_before>angular.module('F1FeederApp.controllers', []).

  /* Drivers controller */
  controller('driversController', function($scope, driversFromService) {
    $scope.nameFilter = null;
    $scope.driversList = [];
    $scope.searchFilter = function (driver) {
        var re = new RegExp($scope.nameFilter, 'i');
        return !$scope.nameFilter || re.test(driver.Driver.givenName) || re.test(driver.Driver.familyName);
    };

      $scope.driversList = driversFromService.data.MRData.StandingsTable.StandingsLists[0].DriverStandings;

  }).

  /* Driver controller */
  controller('driverController', function($scope, $routeParams, ergastAPIservice) {
    $scope.id = $routeParams.id;
    $scope.races = [];
    $scope.driver = null;

    ergastAPIservice.getDriverDetails($scope.id).success(function (response) {
        $scope.driver = response.MRData.StandingsTable.StandingsLists[0].DriverStandings[0]; 
    });

    ergastAPIservice.getDriverRaces($scope.id).success(function (response) {
        $scope.races = response.MRData.RaceTable.Races; 
    }); 
});<commit_msg>using resolve promise in order to load data on controller before rendering html view<commit_after>angular.module('F1FeederApp.controllers', []).

    //driversFromService injected here being retrieved by ergastAPIservice.getDrivers() using promise 'resolve' on $routeProvider

  /* Drivers controller */
  controller('driversController', function($scope, driversFromService) {
    $scope.nameFilter = null;
    $scope.driversList = [];
    $scope.searchFilter = function (driver) {
        var re = new RegExp($scope.nameFilter, 'i');
        return !$scope.nameFilter || re.test(driver.Driver.givenName) || re.test(driver.Driver.familyName);
    };

      $scope.driversList = driversFromService.data.MRData.StandingsTable.StandingsLists[0].DriverStandings;

  }).

  /* Driver controller */
  controller('driverController', function($scope, $routeParams, ergastAPIservice) {
    $scope.id = $routeParams.id;
    $scope.races = [];
    $scope.driver = null;

    ergastAPIservice.getDriverDetails($scope.id).success(function (response) {
        $scope.driver = response.MRData.StandingsTable.StandingsLists[0].DriverStandings[0]; 
    });

    ergastAPIservice.getDriverRaces($scope.id).success(function (response) {
        $scope.races = response.MRData.RaceTable.Races; 
    }); 
});
{'fraction_non_alphanumeric': 0.14153327716933445, 'fraction_numerical': 0.003369839932603201, 'mean_word_length': 4.118534482758621, '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': '7440717', 'n_tokens_mistral': 742, 'n_tokens_neox': 699, 'n_words': 109}