1. JsView
  2. EjsView
    1. Slot
    2. Partials

Create a new folder called myapp/views.

Create a file called myapp/views/MyView.ejs and paste the following content:

The result of 2+5 = <%= (2+5) %>.

Now change your controller at controllers/main-controllers.js to the following:

new Controller("hello", {
    "execute": function(params, context) {
         return function(cb) {
             context.view_name = "MyView";
             cb();
         };
    }
});

And launch the application with

$ node run_console.js hello

it will output now

The result of 2+5 = 7.

Comments