Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .service('courcesDAO', ['$http', 'session', '$location', function ($http, session, $location) {
- this.post = function (data) {
- return $http.post('/cources', {
- data: data
- })
- .success(function (data, status) {
- console.log(data);
- });
- };
- this.getAll = function (callback) {
- return $http.get('/cources')
- .success(function (data, status) {
- callback(data);
- });
- };
- this.get = function (id, callback) {
- return $http.get('/cources/' + id)
- .success(function (data, status) {
- callback(data);
- });
- };
- this.delete = function (data) {
- return $http.delete('/cources', {
- data: data
- })
- .success(function (data, status) {
- console.log(data);
- });
- };
- }])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement