Skip to content

Layout undefined? #18

@KevinBurton

Description

@KevinBurton

I have a simple EJS template:

<% layout('layout') -%>
<section class="content">
    <div ng-view>
        <h2><%= mongoFormName %></h2>
    </div>
</section>

But I am getting an error:

ReferenceError: H:\building-angularjs-nodejs-apps-mean\3-building-angularjs-node
js-apps-mean-m3-exercise-files\FormManager\form-manager\server\views\index.ejs:1

 >> 1| <% layout('layout') -%>
    2| <section class="content">
    3|  <div ng-view>
    4|          <h2><%= mongoFormName %></h2>

layout is not defined

Is it the keyword 'layout' that is undefined? I changed the argument to 'layout' and I still got the error that 'layout is not defined'. So my conclusion is that the keyword layout is not defined. I think I followed the steps in the documentation:

var express = require('express'),
  engine = require('ejs-mate'),
. . . . 
app.engine('ejs', engine);

app.set('views', __dirname + '/server/views');
app.set('view engine', 'ejs');

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions