1
I’m trying to develop a system with Node.js and I’m trying to list the database data in my table, but the data stay together this way:
I still don’t know much about Json, is it because he’s this way?
That’s my job to list:
Usuario.find(function (err, data) {
if(err){
console.log(err);
}
res.render("usuarios/index", {lista: data});
});
And this is my page:
extends ../layout
block content
h1 Página de Usuários
br
br
a(href="/" title="Home") Voltar
br
br
table(class="table well")
thead
tr
th ID:
th Nome:
th Login:
th Senha:
th Data:
tbody
each valor, i in lista
tr
td #{valor.id}
td #{valor.nome}
CMD:
you’re using
Jade
right?– Sergio
what gives
console.log(typeof data, data);
within thatUsuario.find()
?– Sergio
I edited the question and put an image with what appears
– DiegoAugusto
Give an insight into the table and show how it is being rendered. Only one addendum, the way the JSON is not interfering with the way the data is displayed on the screen
– paulojean
I really forgot to think about it, I didn’t know I had it in Jade. Problem solved
– DiegoAugusto
Put an answer so I can tag it as a solution.
– DiegoAugusto