Max
Max

Reputation: 1459

Partial Not Defined in Jade

Here is what I have in index.jade. And yes I am using express.js

extends layout

block content
  h1 Invoices:
  != partial("invoice")

This matches what I see in every single Jade/Express tutorial. But I get "Reference error: partial not defined". Any ideas why?

Upvotes: 8

Views: 6650

Answers (2)

Kyeotic
Kyeotic

Reputation: 19847

Use include, without quotes (This example is from the jade documentation)

users = [{ name: 'Tobi', occupation: 'Ferret' }]

each user in users
  .user
    include invoice

Where invoice is your "partial" template.

Upvotes: 16

Pavan Kumar Sunkara
Pavan Kumar Sunkara

Reputation: 3025

Jade newest version doesn't support partials. You might be following outdated tutorials. Please read up on jade documentation here

Upvotes: 8

Related Questions