Last active
January 4, 2016 04:49
-
-
Save robwormald/8571379 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
innitApp.factory('TimeLog',function(Restangular){ | |
var TimeLog = Restangular.all('timelog') | |
return { | |
find : function(query){ | |
return TimeLog.getList(query) | |
}, | |
findById : function(query){ | |
return TimeLog.get(query) | |
}, | |
create : function(obj){ | |
console.log(obj) | |
return TimeLog.post(obj,{},{'Content-Type' : 'application/json'}) | |
} | |
} | |
}) | |
innitApp.factory('Employee',function(Restangular){ | |
var _Employees = Restangular.all('employee') | |
return { | |
find : function(query){ | |
return _Employees.getList(query) | |
}, | |
findById : function(query){ | |
return Restangular.one('employee',query.id).get() | |
}, | |
create : function(obj){ | |
return _Employees.post(obj) | |
} | |
} | |
}) | |
innitApp.factory('Project',function(Restangular){ | |
var Project = Restangular.all('project') | |
return { | |
find : function(query){ | |
return Project.getList(query) | |
}, | |
findById : function(id){ | |
return Project.get(id) | |
}, | |
create : function(obj){ | |
console.log(obj) | |
return Project.post(obj) | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment