Now that we have the individual ("lower order") functions
render_main #51, render_item #52, and render_footer #53
for rendering the sections of the todo app,
we can write the view function to render the entire app!
With the main and footer "partial" views built, the overall view is rediculously simple:
To save on repetition, and illustrate just how simple the view is, this is the "HTML"
with the <section class"main"> and <footer class="footer"> partials replaced by invocations to the respective functions render_main #51 and render_footer #53:
<section class="todoapp">
<header class="header">
<h1>todos</h1>
<input class="new-todo" placeholder="What needs to be done?" autofocus="">
</header>
render_main(model)
render_footer(model)
</section>
Acceptance Criteria
View displays:
[x] <h1> containing the title text "todos".
[x] <input class="new-todo"> has placeholder text "What needs to be done?"
[x] <ul class="todo-list"> list of todo items has zero items by default.
[x] <footer> count is Zero when the app is first rendered with no todos in the model.
Now that we have the individual ("lower order") functions
render_main
#51,render_item
#52, andrender_footer
#53 for rendering the sections of the todo app, we can write theview
function to render the entire app!With the
main
andfooter
"partial" views built, the overallview
is rediculously simple:To save on repetition, and illustrate just how simple the
view
is, this is the "HTML" with the<section class"main">
and<footer class="footer">
partials replaced by invocations to the respective functionsrender_main
#51 andrender_footer
#53:Acceptance Criteria
View displays:
<h1>
containing the title text "todos".<input class="new-todo">
has placeholder text "What needs to be done?"<ul class="todo-list">
list of todo items haszero
items by default.<footer>
count is Zero when the app is first rendered with no todos in themodel
.