Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.get('/todos',function(req,res){
- Todo.find({},function(err,todos){
- if(err){
- return res.json({ success: false,'msg':"Ha ocurrido un error mostrando las tareas", error:err})
- }
- res.status(200).send({success: true, result:todos})
- })
- })
- public getTodos(){
- return this.http.get(this.apiUrl+'todos')
- .map(response=>response.json().result)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement