Book Image

Web Development with MongoDB and NodeJS Second edition

Book Image

Web Development with MongoDB and NodeJS Second edition

Overview of this book

Table of Contents (19 chapters)
Web Development with MongoDB and NodeJS Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
12
Popular Node.js Web Frameworks
Index

Templating engines


As we already know, a Model View Controller (MVC) application framework divides the application-specific code into models, views, and controllers. Controllers are supposed to be handling the task of binding the appropriate data to its relevant views to generate the output for an incoming web application request. So, views are supposed to be independent of the data and only contain code relevant to the presentation of the data, which will be mostly HTML. Apart from HTML, views will need to contain presentation logic, which will be conditions written on the data passed to them via controllers. Then, the main task that templating frameworks do in this case is that they make this process of embedding presentational logic simpler and readable. Also, they attempt to segregate the views into more understandable subcomponents.