Thursday 20 April 2017

Passing values from router to view in node js

I'm trying to pass a message from router to my ejs view index. but when i load the view on browser it says the object key is undefined

    if(data != null){
        if(data.name == req.body.name){
            res.render('index', {err: 'The name already exist'});
        }
    }

this is the statement and i'm trying to display this error when user clicks submit button

thank you



via Chathura Buddika

No comments:

Post a Comment