Sha256: 810e6f0f88642c45f2f3085becee4e31ec7b742237d9926d6cf0502cde2527e6
Contents?: true
Size: 924 Bytes
Versions: 20
Compression:
Stored size: 924 Bytes
Contents
;(function() { 'use strict'; function Goals($resource) { var GoalResource = $resource('/social_networking/goals/:id', { id: '@id' }); function Goal() {} // Persist a Goal to the server. Goal.create = function(attributes) { var goal = new GoalResource({ description: attributes.description, isCompleted: attributes.isCompleted, dueOn: attributes.dueOn }); return goal.$save(); }; // Update a Goal on the server. Goal.update = function(attributes) { var goal = new GoalResource({ id: attributes.id, description: attributes.description, isCompleted: attributes.isCompleted, isDeleted: attributes.isDeleted, dueOn: attributes.dueOn }); return goal.$save(); }; return Goal; } angular.module('socialNetworking.services') .service('Goals', ['$resource', Goals]); })();
Version data entries
20 entries across 16 versions & 1 rubygems