title: Delete a id using Angular
body: <p>Users can search for a movie title in my inputfield and it will show them a list of movies. They can then hover over a title and a <code>Add Movie</code> button pops up. They can click it so it gets added to their frontpage. But now I'm trying to figure out how they can remove that movie from the database. But I can't find a clear example on how to do this.</p>
  
  <p>This is how I show the movies,</p>
  
  <pre><code>%div{"ng-repeat" =&gt; "movie in movies"}
    {{ movie.id }}
    {{ movie.title }}
    %a{"ng-click" =&gt; "deleteMovie($index)"}delete
  </code></pre>
  
  <p>I think I have to create a delete action in my controller called <code>deleteMovie</code> which works with a service to remove the id from the database.</p>
  
  <p>This is how I see the service,</p>
  
  <pre><code>.factory('removeMovie', ['$http', function($http) {
    return {
      deleteMovie: function() {
        return $http.delete('/movies.json/$id');
      }
    };
  }])
  </code></pre>
  
  <p>The <code>deleteMovie</code> would be called in the controller. But I have the feeling I'm approaching this the wrong way.</p>