jayko03
jayko03

Reputation: 2481

How does layout.jade and its children work?

I am learning express 4.0 and the tutorial uses layout.jade and some children jade.

They connect block content and extends layout In my layout.jade file, there is only one block content.

However I have three jade files that start extends layout and block content.

How does jade know what to put inside of layout.jade?

Thank you!

Upvotes: 0

Views: 40

Answers (1)

user4233921
user4233921

Reputation:

Jade fills in the blocks of the parent template based on the matching blocks defined in the extending child you are rendering. It helps to to keep your code more DRY.

Upvotes: 1

Related Questions