Implementing HTML templates in the Express JS framework for the MEAN stack.This involves opening and making some minor changes to the app.js file in the root of your project directory. Is there a difference between lauch js functions from same JS file where they declared after page load, or in html template?I assume that no, but I ran into a problem when replace my ExampleService.init() function from template to separate JS file. First: putting the JS into its own .js file and including it via . There are a number of HTML template solutions out there: jQuery Templates, Underscore. js, and Mustache.js to name a few.To start using Mustache.js, simply add a script tag to your html file pointing to mustache. js which is available here. Embedded JS (EJS) is inspired by ERB templates and acts much the same.