Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

view function in Todo List App #54

Closed
4 tasks done
nelsonic opened this issue Aug 7, 2018 · 2 comments
Closed
4 tasks done

view function in Todo List App #54

nelsonic opened this issue Aug 7, 2018 · 2 comments

Comments

@nelsonic
Copy link
Member

nelsonic commented Aug 7, 2018

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.
@nelsonic
Copy link
Member Author

nelsonic commented Aug 7, 2018

app.view-not-a-function

@nelsonic
Copy link
Member Author

nelsonic commented Aug 7, 2018

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant