Skip to content

view function in Todo List App #54

Closed
@nelsonic

Description

@nelsonic

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:

todoapp-view

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:

  • <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 has zero items by default.
  • <footer> count is Zero when the app is first rendered with no todos in the model.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions