Answer the question
In order to leave comments, you need to log in
With this approach, always use bind?
Such a code troller, for example
class Index {
constructor(title) {
this.title = title;
}
mainPage(req, res, next) {
let data = {
title: this.title
};
res.render('index', data);
}
}
module.exports = new Index('Тайтл главной страницы из конструктора контроллера Index');
var index = require('../controllers/index');
router.get('/', index.mainPage.bind(index));
module.exports = router;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question