Kyle continues his walkthrough of the application code. He describes how the templates in are built and how they get injected into the application. Hey also has code watching the templates directory to reload the templates when they are changed. The templates are created with Grips.
- So, where does Tmpls.js come from?…You'll notice it's in the web/js directory.…Where does that thing come from?…Well, I actually have another utility here…called build templates.…It's a script that is in the main route of your file…and if you look at build templates...…Let me zoom out.…It's just a little easier to see more at a time.…What build templates does...…I can scroll down here.…Essentially what is does is you spin it up.…You run this program…and it will process through all the templates…that are in the templates directory.…
These are grips templates.…If you were using a different templating engine,…if you didn't like grips,…then you'd just be using a gulp or a grunt process…for whatever engine you want.…Again, not to overload people,…we're not using grunt and gulp here.…I'm not saying that those aren't good tools,…but that's yet more machinery that I have to teach you,…so I'm showing you how to do it…without even invoking any other tool.…This is just a simple script that I wrote…to go through the files and templates directory…
Note: This course was created on 03/29/2016 by Frontend Masters. We are pleased to host this content in our library.
- Carousels, panes, and modules
- Middle-end architecture
- Secure phrase generator
- Routing functions
- Calling the API
- Rendering on the page
- Shared data validation
Skill Level Intermediate
2. Organizing Code
5. Adding a Shared Module
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.