GithubHelp home page GithubHelp logo

deprecated-lab-angular-data-binding's Introduction

Ironhack logo

Angular | IronNutrition

Introduction

At this point in the course, some of us may be reminiscing about times before the course, when we used to work out and we were fit and in shape. Surprising as it may be, spending many hours each day sitting in front of the computer is not an effective way to attain, and maintain, a rock-hard physique.

Our solution: A nutrition app.

And it's your job to build it.

Requirements

  • Fork this repo
  • Clone this repo into your ~/code/labs
  • You must use at least 1 of each of the following:
    • component
    • pipe
    • ngFor
    • ngIf
    • ngModel

In the starter code, we've provided a list of foods in the form of a TypeScript array of objects. This has already been imported into the foods-list component provided to you.

Submission

Upon completion, run the following commands

$ git add .
$ git commit -m "done"
$ git push origin master

Navigate to your repo and create a pull request from your master branch to the original repository master branch.

In the pull request name, add your name and last names separated by a dash "-"

Instructions

Iteration 1 | Display Foods

In the app-food-list component, display a list of the foods. This should include the food's image, its name, and its calorie count.

Notice, we've already imported an array of objects containing food into the component.

Make sure the image's src property is properly bound so that any time the value is changed in the TypeScript class, the change is reflected in the DOM.

Iteration 2 | Search Foods

Create an input box to search through the foods by name.

You're going to need to generate a custom pipe to do this. Reference the example from the lesson on pipes, as it will be very similar.

Iteration 3 | Add New Foods

Create a button to add new foods.

When a user clicks the button, a form will appear with fields for a name, number of calories, and an image.

When the user clicks submit, the food will be added to the list.

The form should disappear when the user clicks the submit button.

Iteration 4 | Today's Foods List

Create a button next to each item. When a user clicks the button, the corresponding food should be added to a special list of foods which are "today's foods".

Somewhere on the page, display a list of today's foods, with a total calorie count.

Bonus | Quantities

In addition to the "Add to today's list" button, create an input for quantity. Whenever a user enters a number into the input, you should add that many of the item to their list.

The default quanitity should be 1.

Super Bonus

If the user has added more than one item of the same type to their list, don't display it twice. Instead, display the item's name, and the number of times it has been added.

For instance:

  • Banana x2
  • Salmon x5
  • Cake

deprecated-lab-angular-data-binding's People

Contributors

lluisarevalo avatar nizaroni avatar papuarza avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.