Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.service("modelService",[ "$http", function($http) {
- var model = linksharemodel;
- var insertVote = function(vote) {
- $http.post("CampusRandomLinks/CampusRandomLinks/InsertVote",
- { 'vote': vote }).
- success(function(data, status, headers, config) {
- // this callback will be called asynchronously
- // when the response is available
- model = data;
- }).
- error(function(data, status, headers, config) {
- // called asynchronously if an error occurs
- // or server returns response with an error status.
- });
- };
- var get = function() {
- return model;
- };
- return {
- insertVote: insertVote,
- get: get,
- };
- }]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement