Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMatthew Day
6,740 PointsIs 'HTML template' the proper term to refer to 'index.html'?
At 3:16, Huston says, "The last thing we do to get started, is to bootstrap our angular app within the HTML template." I know this may be splitting hairs but I've always considered template to refer to something that will be used more than once but index.html
is the main page, not something that other pages use as a template. And given that I recently completed Huston's course on Express basics where he talks about Jade templates, his use of the word here threw me off for a second. But I am curious if referring to index.html
as a template is correct.
1 Answer
shadrackndacayisenga
Python Web Development Techdegree Student 14,189 PointsRiley here is as correct as the topic can go.
By definition a template is a file used as pattern or framework for front-end content presentation; usually implemented as complete or just significant subset of the entire interface.
Most of the times, the word template gives a connotation that it should be, or should hold variable data that are rendered to be really a template. And that is exactly what index is, holds raw html, css, js, and links that, are otherwise incomplete (in function) unless rendered by a capable rendering engine.
A template, in essence is made of elements that give an overall structural overview and position of certain collections of values.
index.html passes most if not all the attributes of a template. By that I conclude that index.html it is in fact both by nature and definition (at by current use) a template.
Riley Hilliard
Courses Plus Student 17,771 PointsRiley Hilliard
Courses Plus Student 17,771 PointsEspecially with SPA frameworks like Angular, parts of the application that deal with the markup are considered templates. They are the "View" part of the frontend "MVC" architecture, therefore referring to them as templates or template files is correct. Even the index.html page is a template file.