I'm facing an issue with a script in express. I have a function that renders a view upon the success of another function. This project involves angular, node, express, and ejs as the view engine. However, when I try to render the view, I encounter an ejs error like this:
ReferenceError: /Users/emilywfrancis/Desktop/nodejs-angularjs-sequelizejs/views/about.ejs:5
3| <html ng-app="app">
4| <meta charset="utf-8">
5| <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/3.1.0/css/font-awesome.min.css" />
6| <% include header %>
7| <% include navbar %>
8| <body>
title is not defined
Below is the code snippet causing the issue:
exports.verifyusers= function(req, res) {
models.user.find({
where: {
email: req.body.email,
password: req.body.password
}
}).then(function(res, user) {
if(user == "user.name") { //if user exists in database
res.render('/about')
};
});
};