I want to render my json in jade.I m sending Json Data but this give error like this
app.get('/showRequestAccepted',function(req,res){
Account.getFriends(req.user,{"friends.status":Status.Accepted},function(err,sonuc) {
if(err) throw err
//Json'i formatted göstermek için null ve 4 boşluk için
else
console.log(sonuc);
res.render('profil',{sonuc:JSON.stringify(sonuc)});
});
});
in Jade Using Jade to iterate JSON I find this example this is not help me
each jsonObj in sonuc
li=jsonObj.username
I m getting this error
500 TypeError: /Users/ANTEGRUP/Desktop/passport-local-master/views/profil.jade:31 29| 30| div#userlist > 31| each jsonObj in sonuc 32| li=jsonObj.username 33| 34| Cannot read property 'length' of undefined