Giter VIP home page Giter VIP logo

intro_to_angular_lab's Introduction

Intro to Angular Lab

For tonight's lab we'd like you to apply some of the new Angular directives learned and in a Rails app, play around with these directives.

To review, we learned about

ng-app
ng-model
ng-show
ng-hide
ng-style
ng-class
ng-list
ng-pluralize
ng-repeat
ng-show
ng-hide
filters (orderBy, limitTo)
custom filters

Objectives

  1. Create a new rails app and include angular in your application

  2. Create a rails controller and template to render a basic home page

  3. Create your app and controller in an app.js or app.js.coffee file

  4. Create an array of objects called favoriteMovies and use the ng-repeat directive to iterate over the array of favoriteMovies.

  5. Add a form outside the ng-repeat in step 4 with an input that allows you to change the background color of the application. This will require you to look at the documentation for ng-style or review the notes. (Hint: Use the backgroundColor key instead of background-color)

  6. Filter your ng-repeat of movies and order them by name and limit the number displayed to 3

  7. Create a custom filter to reverse the letters of the title of your favorite movies

  8. Write a function called removeFavorite that removes a favorite movie from your array.

  9. Include the text "I have {{favoriteMovies.length}} favorite(s)" and use ng-pluralize so that the text displays favorite when there is 1 movie and favorites in all other cases

  10. Add a checkbox that allows the user to see the list of favorite movies when checked and hides the list of movies when unchecked.

  11. Check out ng-keypress and create an input field and a counter that increments every time the user types a letter.

  12. Create a form that takes in a word and then hides it when the form is submitted.

Bonus:

  1. Write this all in CoffeeScript!
  2. Go to Google fonts and pick out three favorite fonts and drop them into your head, then use the ng-style and ng-model directives to change the text color and font.
  3. Use $watch to listen to when the secret word is typed and using your counter from exercise 10 show the secret word if the user has typed more than 20 characters

intro_to_angular_lab's People

Contributors

smonette avatar elie avatar

Watchers

James Cloos 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.