title: MEAN stack user delete
body: <p>I've got a users list with delete button on <code>/users</code> url. My delete route looks like this:</p>
  
  <pre><code>app.route('/users/:userId')
      .get(users.read)
      .put(users.updateById)
      .delete(users.delete);
  app.param('userId', users.userById);
  </code></pre>
  
  <p>But problem is, that my delete button is calling delete on <code>/users</code> url, so I'm getting <code>DELETE http://localhost:3000/users 404 (Not Found)</code>. How can I solve this problem? My controller remove() function you can see below. How can I pass <code>'/user/' + user._id</code> to it? User is removed correctly only from scope :(</p>
  
  <pre><code>$scope.remove = function(id) {
      var user = $scope.users[id];
      var modalOptions = {
          closeButtonText: 'Cancel',
          actionButtonText: 'Delete user',
          headerText: 'Delete ' + user.displayName + '?',
          bodyText: 'Are you sure you want to delete this user?'
      };
  
      modalService.showModal({}, modalOptions).then(function() {
          if (user) {
              user.$remove();
  
              for (var i in $scope.users) {
                  if ($scope.users[i] === user) {
                      $scope.users.splice(i, 1); // remove item from scope
                  }
              }
          }
      });
  
  };
  </code></pre>
  
  <p>user service is basic from mean.js installation</p>
  
  <pre><code>angular.module('users').factory('Users', ['$resource',
      function($resource) {
          return $resource('users', {}, {
              update: {
                  method: 'PUT'
              }
          });
      }
  ]);
  </code></pre>