Skip to Content
Learning Node.js Development
book

Learning Node.js Development

by Andrew Mead
January 2018
Beginner
658 pages
13h 10m
English
Packt Publishing
Content preview from Learning Node.js Development

Injecting data inside of templates

Let's come up with some things that we want to make dynamic inside our handlebars file. First up, we'll make this h1 tag dynamic so the page name gets passed into the template in about.hbs page, and we'll also add a footer. For now, we'll just make that a simple footer tag:

    <footer>          </footer>  </body></html>

Inside of the footer, we'll add a paragraph and that paragraph will have the copyright for our website. We'll just say something like copyright followed by the year, which is 2018:

    <footer>      <p>Copyright 2018</p>    </footer>

Now year should also be dynamic, so that as the years change, we don't have to manually update our markup. We'll look at how to make both the 2018 and the about page dynamic, which ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Advanced Node.js Development

Advanced Node.js Development

Andrew Mead
Node.js: Tools & Skills, 2nd Edition

Node.js: Tools & Skills, 2nd Edition

James Hibbard, Michael Wanyoike, Nilson Jacques, Jay Raj, Manjunath M
Your First Week With Node.js, 2nd Edition

Your First Week With Node.js, 2nd Edition

James Hibbard, Craig Buckler, Mark Brown, Nilson Jacques, James Kolce, Paul Orac, M. David Green, Florian Rappl

Publisher Resources

ISBN: 9781788395540Supplemental Content