Giter Site home page Giter Site logo

intro-angular-lab's Introduction

Intro Angular Lab

Objective: Set up a new Angular app and apply your knowledge of Angular's built-in directives.

Getting Started

  1. Fork this repo, and clone it into your develop folder on your local machine.
  2. Change directories into intro-angular-lab, and follow the instructions from this morning's module to set up a new Angular app. You will need:
    • index.html with links to the Angular CDN and app.js.
    • ng-app and ng-controller directives in the HTML.
    • app.js that initializes your Angular app and adds a controller.
  3. Run budo app.js --open from your Terminal to start your server and open your app in the browser.*
  4. Implement solutions to the following challenges. Refer to the solution branch for guidance.

* (You may need to npm install -g budo to do this. Or just fire up your server another way. Budo is a dev tool that serves your code and bundles on the fly.)

Challenges

  1. Inside your Angular controller, create an array of objects $scope.moviesToWatch, and use the ngRepeat directive to iterate over your list of movies and display them in the view.

  2. Use the orderBy filter to sort the list of movies by name in descending order.

  3. Include the text "{{moviesToWatch.length}} movies to watch", and use the ngPluralize directive so that the text displays "movie" when there is one movie and "movies" in all other cases.

  4. Create a form on the page for a user to add a new movie to the list. Write a function called addMovie and use the ngSubmit directive to add the new movie to $scope.moviesToWatch when the user submits the form.

  5. Use the limitTo filter to limit the number of movies displayed to five. Bonus: Add a link for the user to "View More". Clicking the link should allow the user to view the entire list of movies.

  6. Put an icon next to each movie that resembles an "X" or a trash can. When the user clicks the icon, delete the movie from the list. Hint: Write a function called deleteMovie, and use the use the ngClick directive.

Bonus

  1. Implement a way for the user to mark a movie as "watched". Use the ngStyle or ngClass directive to strikethrough the text of the movie if it's been "watched".

  2. Give each movie in $scope.moviesToWatch an image. Make a button in the view for the user to change the background. When the user clicks the button, set the app's background to a random movie image from $scope.moviesToWatch. Every time the user clicks the button, they should see a different background image.

Submission

  • As you make code changes, frequently commit and push to GitHub.
  • Once you've finished the assignment and pushed your work to GitHub, make a pull request from your fork to the original repo.

Optional Practice

Resources

intro-angular-lab's People

Contributors

cameronjacoby avatar

Watchers

James Cloos avatar  avatar Brianna Veenstra avatar Alex White avatar Ben Hulan avatar Ben Manning avatar  avatar Dani Zaghian 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.