dwyl / phoenix-liveview-todo-list-tutorial

✅ Beginners tutorial building a Realtime Todo List in Phoenix 1.6.10 + LiveView 0.17.10 ⚡️ Feedback very welcome!
https://liveview-todo.herokuapp.com/
69 stars 11 forks source link

Item left count is not working #57

Closed gustvoassuncao closed 1 year ago

gustvoassuncao commented 2 years ago

Hello, At the tutorial to build a todoApp, the items left is not showing on the screen and please implement those codes in the tutorial bellow the <span class="todo-count">:

lib/live_view_todo_web/live/page_live.html.heex

      <%= Enum.count(Enum.filter(@items, fn i -> i.status != 1 end)) %>
      <%= if Enum.count(Enum.filter(@items, fn i -> i.status != 1 end)) == 1 do %>
        item
      <% else %>
        items
      <% end %>

I think that's all, thank you so much for this amazing tutorial, I learnet a lot from it! 🚀