Created
July 9, 2011 18:58
-
-
Save dtan/1073845 to your computer and use it in GitHub Desktop.
using partials in express
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
folder structure: | |
- views | |
- login.jade | |
- partials | |
- form | |
- input.jade | |
// ======= login.jade: | |
h1= title | |
form(action="/", method="POST") | |
!= partial('partials/form/input', { label: { for: 'email', label: 'Email' }, input: { name: 'email', value: '[email protected]', type: 'email' } }) | |
div | |
label(for="password") Password | |
input(type="password", name="password", value="") | |
div | |
input(type="submit", value="Submit") | |
// ======= partials/form/input.jade: | |
div | |
label(for=label.for)= label.label | |
input(type=input.type, name=input.name, value=input.value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment