Advertisement
Guest User

Untitled

a guest
May 22nd, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. app.service("modelService",[ "$http", function($http) {
  2.     var model = linksharemodel;
  3.     var insertVote = function(vote) {
  4.         $http.post("CampusRandomLinks/CampusRandomLinks/InsertVote",
  5.             { 'vote': vote }).
  6.             success(function(data, status, headers, config) {
  7.                 // this callback will be called asynchronously
  8.                 // when the response is available
  9.                 model = data;
  10.             }).
  11.             error(function(data, status, headers, config) {
  12.                 // called asynchronously if an error occurs
  13.                 // or server returns response with an error status.
  14.             });
  15.     };
  16.  
  17.     var get = function() {
  18.         return model;
  19.     };
  20.  
  21.     return {
  22.         insertVote: insertVote,
  23.         get: get,
  24.     };
  25. }]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement