Using Expressions

Objectives

  • Integrate expressions to show data count
  • Conditionally display text using expressions

Instructions

First off, run npm install to install the dependencies for this lab.

In this repo we've got a (very basic) EmailController, showing a list of emails and allowing us to add an email to the list.

In our <h6> tag we've got You have emails - let's make this more dynamic!

Using our previous knowledge of ternary operators and displaying the length of an array, change the wording to put the number of emails in there. If there are no emails, we should put the word 'no' in there instead.

You should end up with You have no emails or You have 6 emails - etc!