Advertisement
Guest User

Untitled

a guest
Jul 29th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .service('courcesDAO', ['$http', 'session', '$location', function ($http, session, $location) {
  2.         this.post = function (data) {
  3.             return $http.post('/cources', {
  4.                     data: data
  5.                 })
  6.                 .success(function (data, status) {
  7.                     console.log(data);
  8.                 });
  9.         };
  10.         this.getAll = function (callback) {
  11.             return $http.get('/cources')
  12.                 .success(function (data, status) {
  13.                     callback(data);
  14.                 });
  15.         };
  16.         this.get = function (id, callback) {
  17.             return $http.get('/cources/' + id)
  18.                 .success(function (data, status) {
  19.                     callback(data);
  20.                 });
  21.         };
  22.         this.delete = function (data) {
  23.             return $http.delete('/cources', {
  24.                     data: data
  25.                 })
  26.                 .success(function (data, status) {
  27.                     console.log(data);
  28.                 });
  29.         };
  30.         }])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement