challenges: WIP beginning challenges feature. some basic CRUD & some

basic subscribe / unsubscribe functional (but buggy)
This commit is contained in:
Tyler Renelle
2013-10-26 17:24:45 -07:00
parent e45d8307e7
commit fa25f3d300
16 changed files with 755 additions and 43 deletions

View File

@@ -0,0 +1,25 @@
'use strict';
/**
* Services that persists and retrieves user from localStorage.
*/
angular.module('challengeServices', ['ngResource']).
factory('Challenges', ['API_URL', '$resource', 'User', '$q', 'Members',
function(API_URL, $resource, User, $q, Members) {
var Challenge = $resource(API_URL + '/api/v1/challenges/:cid',
{cid:'@_id'},
{
//'query': {method: "GET", isArray:false}
join: {method: "POST", url: API_URL + '/api/v1/challenges/:cid/join'},
leave: {method: "POST", url: API_URL + '/api/v1/challenges/:cid/leave'}
});
//var challenges = [];
return {
Challenge: Challenge
//challenges: challenges
}
}
]);