Now that you have finished the tutorial, we will make a coffee rating website! Setting up: To help you get started, download a skeleton to build an angular app on, called Angular-Seed. Go to *this* https://github.com/angular/angular-seed/blob/master/README.md link and follow the instruction to download the seed, naming your project ‘coffees.’ Note: Although you can ignore a lot of these files (the node directory, the karma files, view1/view2, etc), by downloading the seed you can get around issues such as creating the server (this does it for you), and if you were going to use a backend, having node all set up for you is really nice. Now that you’ve downloaded the seed, you will need to modify the following files: app.js, and index.html. Furthermore, you will add the following files: coffees.html, and reviews.html.
Your site will need to use ‘ngRoute’ with two views on top of index.html. One view (coffees.html) will be a list of all coffees in the database, sorted by name. There should be a search box at the top to find a particular coffee. Each listing in the table should include a brand, a name, a location, and a link to see the reviews of that coffee. Here’s what it may look like before CSS:
Once you click the link, it should go to the second view (reviews.html). This should be another table, of all of the reviews for the coffee list. Note: in order to keep a variable in a controller when you switch between two different views (instead of resetting the variables), use $rootScope as a dependency for that controller. For example, if you want to keep the id of the selected coffee, making it $rootscape.selectedID in your controller will keep the value of that variable when you switch from coffees.html to reviews.html. Here’s what your reviews.html may look like before CSS:
At all times, there should be a button at the top (not in either view, but in the main page) that takes you home (coffees.html). In app.js, you will need to copy the following array into your controller:
This will be your “database,” as we are not going to use the “$http” dependency. The following is needed for the site:
Finally, use CSS and UI Bootstrap (view the reference ____here[ https://angular-ui.github.io/bootstrap/ ), to make the site look pretty. Although you’re allowed to use whatever CSS/Bootstrap you want, UI Bootstrap makes things really easy. For example, using stars in the rating directives to display ratings instead of a number. Please follow the installation instructions carefully. The following files should be in your index.html if you are using UI Bootstrap. <script src "bower_components/angular-bootstrap/ui-bootstrap.js"></script>
At the end, your coffee site should look something like this:
Grading_______ 1. Completed Google Angular Tutorial steps 0-9 (5 points) 2. Completed coffee web application (45 points) a. Index.html (5 points) i. Working button with back to home button at all times (3 points) ii. Sets up angular correctly (2 points) b. App.js (10 points) i. Set up module ( 5 points) ii. Controller (5 points) 1. Have one controller for the project ( 2 points) 2. Use scope and rootScope injections (3 points) c. Coffees.html (15 points): i. List of all coffees sorted by name (3 points) ii. Search bar, working correctly (4 points) iii. Has Name, Brand, Location, and review link all displayed in one table (3 points) iv. Review link works, and takes you to another view (5 points) d. Reviews.html i. Reviews of correct coffee, and only correct coffee, are listed (10 points) ii. All reviews are Listed ( 2 points) iii. Rating, Comment, and commenter are listed in the same table. (3 points) e. BootStrapping i. Site looks good, intuitive, and professional ( 5 points)