<commit_before>'use strict';

angular.module('myApp', [])
  .controller('MovieController', function($scope, $http){
    $scope.search = "<NAME>";

    $scope.$watch('search', function() {
      fetch();
    });

    function fetch(){
      $http.get("http://www.omdbapi.com/?t=" + $scope.search + "&tomatoes=true&plot=full")
      .then(function(response){ $scope.details = response.data; });

      $http.get("http://www.omdbapi.com/?s=" + $scope.search)
      .then(function(response){ $scope.related = response.data; });
    }

    $scope.update = function(movie){
      $scope.search = movie.Title;
      fetch();
    };

    $scope.select = function(){
      this.setSelectionRange(0, this.value.length);
    }
  });<commit_msg>Some updates to be alligned with article http://www.sitepoint.com/api-calls-angularjs-http-service.<commit_after>'use strict';

angular.module('myApp', [])
  .controller('MovieController', function($scope, $http){
    $scope.$watch('search', function() {
      fetch();
    });

    $scope.search = "<NAME>";

    function fetch(){
      $http.get("http://www.omdbapi.com/?t=" + $scope.search + "&tomatoes=true&plot=full")
      .then(function(response){ $scope.details = response.data; });

      $http.get("http://www.omdbapi.com/?s=" + $scope.search)
      .then(function(response){ $scope.related = response.data; });
    }

    $scope.update = function(movie){
      $scope.search = movie.Title;
    };

    $scope.select = function(){
      this.setSelectionRange(0, this.value.length);
    }
  });
{'fraction_non_alphanumeric': 0.20429407937540664, 'fraction_numerical': 0.0013012361743656475, 'mean_word_length': 3.260387811634349, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 5, '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': '5669338', 'n_tokens_mistral': 507, 'n_tokens_neox': 490, 'n_words': 72}