var app = angular.module('app', ['autocomplete']);

// the service that retrieves some movie title from an url
app.factory('MovieRetriever', function($http, $q, $timeout){
  var MovieRetriever = new Object();

  MovieRetriever.getmovies = function(i) {
    var moviedata = $q.defer();
    var movies;

    var moreMovies = [{name: "Scott O'Malley Wolverine", club:"Salle Dublin" }, {name: "Smurffete", club:"Salle Room" },{name:  "Pembroke Fencer 1" , club:"Pembroke" }, {name: "Laura Jameson", club:"Salle Rocks" }];

    //var moreMovies = ["The Wolverine", "The Smurfs 2", "The Mortal Instruments: City of Bones", "Drinking Buddies", "All the Boys Love Mandy Lane", "The Act Of Killing", "Red 2", "Jobs", "Getaway", "Red Obsession", "2 Guns", "The World's End", "Planes", "Paranoia", "The To Do List", "Man of Steel", "The Way Way Back", "Before Midnight", "Only God Forgives", "I Give It a Year", "The Heat", "Pacific Rim", "Pacific Rim", "Kevin Hart: Let Me Explain", "A Hijacking", "Maniac", "After Earth", "The Purge", "Much Ado About Nothing", "Europa Report", "Stuck in Love", "We Steal Secrets: The Story Of Wikileaks", "The Croods", "This Is the End", "The Frozen Ground", "Turbo", "Blackfish", "Frances Ha", "Prince Avalanche", "The Attack", "Grown Ups 2", "White House Down", "Lovelace", "Girl Most Likely", "Parkland", "Passion", "Monsters University", "R.I.P.D.", "Byzantium", "The Conjuring", "The Internship"]

    if(i && i.indexOf('T')!=-1)
      movies=moreMovies;
    else
      movies=moreMovies;

    $timeout(function(){
      moviedata.resolve(movies);
    },1000);

    return moviedata.promise
  }

  return MovieRetriever;
});

app.controller('MyCtrl', function($scope, MovieRetriever){

  $scope.movies = MovieRetriever.getmovies("...");
  $scope.movies.then(function(data){
    $scope.movies = data;
  });

  $scope.getmovies = function(){
    return $scope.movies;
  }

  $scope.customLabel = function(suggestion){
    return suggestion.name + ' ' + suggestion.club;
  }

  $scope.doSomething = function(typedthings){
    console.log("Do something like reload data with this: " + typedthings );
    $scope.newmovies = MovieRetriever.getmovies(typedthings);
    $scope.newmovies.then(function(data){
      $scope.movies = data;
    });
  }

  $scope.doSomethingElse = function(suggestion){
    console.log("Suggestion selected: " + suggestion );
  }

});
@@ -249,56 +249,8 @@
 i) %7B
-%0A    var moviedata = $q.defer();%0A    var movies;
 %0A%0A  
@@ -1381,197 +1381,27 @@
     
-if(i && i.indexOf('T')!=-1)%0A      movies=moreMovies;%0A    else%0A      movies=moreMovies;%0A%0A    $timeout(function()%7B%0A      moviedata.resolve(m
+return moreM
 ovies
-)
 ;%0A
-    %7D,1000);%0A%0A    return moviedata.promise%0A
   %7D%0A
@@ -1548,75 +1548,8 @@
 ;%0A  
-$scope.movies.then(function(data)%7B%0A    $scope.movies = data;%0A  %7D);%0A
 %0A  $
@@ -1757,16 +1757,16 @@
 hings)%7B%0A
+
     cons
@@ -1838,148 +1838,8 @@
  );%0A
-    $scope.newmovies = MovieRetriever.getmovies(typedthings);%0A    $scope.newmovies.then(function(data)%7B%0A      $scope.movies = data;%0A    %7D);%0A
   %7D%0A

Update app