angular.module('hyloServices', ['ngResource']).

factory('Community', ['$resource',
  function($resource) {
    return $resource('/noo/community/:id', {
      id: '@id'
    }, {
      invite: {
        method: 'POST',
        url: '/noo/community/:id/invite'
      }
    });
  }]).

factory('CurrentUser', ['$resource',
  function($resource) {
    return $resource('/current_user', {}, {
      savePrefs: {
        method: "POST",
        params: {prefs: true}
      }
    });
  }]).

factory('User', ['$resource',
  function($resource) {
    return $resource('/users/:id',
      {
        id: "@id"
      });
  }]).

factory('Notification', ['$resource',
  function($resource) {
    return $resource('/notifications/:id',
      {
        id: "@id"
      },{
        markRead: {
          method: "POST"
        }
      });
  }]).

factory("Post", ["$resource",
  function($resource) {
    return $resource("/posts/:listController:id/:postController:userId",
        {
          id: "@id",
          listController: "@listController",
          postController: "@postController"
        },
        {
          forUser: {
            method: "GET",
            isArray: true,
            params: {
              listController: "user"
            }
          },
          vote: {
            method: "POST",
            params: {
              postController: "vote"
            }
          },
          comment: {
            method: "POST",
            params: {
              postController: "comment"
            }
          },
          getComments: {
            method: "GET",
            isArray: true,
            params: {
              postController: "comments"
            }
          },
          followers: {
            method: "GET",
            isArray: true,
            params: {
              postController: "followers"
            }
          },
          addFollower: {
            method: "POST",
            params: {
              postController: "addfollower"
            }
          },
          removeFollower: {
            method: "POST",
            params: {
              postController: "removefollower"
            }
          },
          follow: {
            method: "POST",
            params: {
              postController: "follow"
            }
          },
          unfollow: {
            method: "POST",
            params: {
              postController: "unfollow"
            }
          },
          markFulfilled: {
            method: "POST",
            params: {
              postController: "markfulfilled"
            }
          }
        })
}]);

@@ -97,38 +97,47 @@
 resource) %7B%0A    
-return
+var Community =
  $resource('/noo
@@ -260,39 +260,659 @@
 /invite'%0A      %7D
-%0A    %7D)
+,%0A      findModerators: %7B%0A        url: '/noo/community/:id/moderators',%0A        isArray: true%0A      %7D,%0A      removeModerator: %7B%0A        url: '/noo/community/:id/moderator/:user_id',%0A        method: 'DELETE'%0A      %7D%0A    %7D);%0A%0A    // let's make things a bit more OO around here%0A    _.extend(Community.prototype, %7B%0A      findModerators: function(success, error) %7B%0A        return Community.findModerators(%7Bid: this.id%7D, success, error);%0A      %7D,%0A      removeModerator: function(params, success, error) %7B%0A        return Community.removeModerator(_.extend(%7Bid: this.id%7D, params), success, error);%0A      %7D%0A    %7D);%0A%0A    return Community
 ;%0A  %7D%5D).%0A%0Afactor

add moderator methods to Community