Here I'm passing id
which stored in m
, please help me how to pass id
. and call that page using that id
. I'm using the embedded JavaScript template as a view engine please help.
$.each(products, function(index, product ) {
var m= product['_id'];
//document.write(alert(m));
string += '<tr><td>'+(index+1)+'</td><td>'+product['_id']+'</td><td>'+product['name']+'</td><td>'+product['category']+'</td><td>'+product['price']+'</td><td>'+product['manufacturer']+'</td><td><a href="/profile/dashboard/update/{{m}}">Update</a> </td></tr>';
});
route code
app.get('/profile/dashboard/update/:m',function (req,res,next) {
console.log("hi"+req.params.m);
});