Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 495
Max Avatar asked Jun 29 '12 18:06

Max


2 Answers

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.

like image 50
Kyeotic Avatar answered Oct 23 '22 07:10

Kyeotic


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

like image 36
Pavan Kumar Sunkara Avatar answered Oct 23 '22 08:10

Pavan Kumar Sunkara