Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. app.get('/todos',function(req,res){
  2. Todo.find({},function(err,todos){
  3. if(err){
  4. return res.json({ success: false,'msg':"Ha ocurrido un error mostrando las tareas", error:err})
  5. }
  6.  
  7. res.status(200).send({success: true, result:todos})
  8. })
  9. })
  10.  
  11. public getTodos(){
  12. return this.http.get(this.apiUrl+'todos')
  13. .map(response=>response.json().result)
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement