Provide project description.
Setup index page.

Generate raffle controller with index action, remove default rails splash page. Change root to our new raffle#index.
Setup angular dependencies.

Angular gem goes under assets, and the application.js file needs to know about it, too. Delete jquery so not tempted to use it.
First implementation of angular.js binding.

Form on index page automatically updates text on screen.
Implement angular controller.

Used ng-controller attribute in html view to define controller. Set up corresponding controller in raffle.js.coffee. Notice how we're looping over the $scope.entries array defined in the controller, by using the ng-repeat attribute in the view.
Make list update on form submission.

Notice ng-submit tag added on form. Upon submit, this calls a function named addEntry that we defined in the raffle.js.coffee.
Add draw winner logic.

Note use of ng-show attribute on .winner span. This means the span is only shown if that winner attribute exists on an entry.
Add conditional styling.

Note use of ng-class attribute. Within the quotes, we use brackets to make a conditional statement. The ng-class is only applied if the given entry had a lastWinner attribute. That attribute was defined in the raffle.js.coffee file.
Improve drawWinner function.

Only pick winners from a pool of people who have not won. Note use of angular.forEach(). The pool array only contains entries that do not have the winner property.
Create entry resource (model and controller).

We're going to connect all this coolness to our database. Also, add some seed data. Don't forget to run db:migrate and db:seed.
Enable fetching of db content into view.

Requiring angular-resource gives us a custom service that represents a RESTful client. We will use this to communicate via JSON to our rails routes for CRUD implementation. Note that every action in our EntriesController uses respond_to :json and respond_with.

app = angular.module("Raffler", ["ngResource"])

At the top of our angular controller, we give our app a name and pass it dependencies, namely the "ngResource" file that we now have access to.

<html ng-app="Raffler">

In order for everything to work, we have to pass this app name into a DOM node that will contain our app logic.

@RaffleCtrl = ($scope, $resource) ->
  Entry = $resource("/entries/:id", {id: "@id"}, {update: {method: "PUT"}})
  $scope.entries = Entry.query()

$resource is a function we can call to return an object that allows us to communicate over our REST API. The first paramater is the url we want it to use. The second is the parameters we want to pass - in this case, the current object'd id, if it has one. (If not the url for Entry to use will be /entries.) The third argument is optional actions you want it to use; most of our actions were accounted for by default, but we do have to define an update action, and tell it to use the PUT method.

http://docs.angularjs.org/api/ngResource.$resource
See the resource docs; there are action keywords which correspond to HTTP methods. Entry.query() corresponds to a GET request on a collection ( .get() just refers to a single resource. )
Can save objects to rails DB.

Note use of .save(), .$update() methods. Once we have instantiated a
resource object by saying entry = Entry.save($scope.newEntry), we can
call resource methods on it like so:
entry.$update();
Refactor creation of Entry resource into factory.

Using a factory to create our Entry resource is the Right Way, but  doing so requires us to change our production config so the minifying that happens to our js files won't screw things up. ("Entry" in factory creation call won't match the minified RaffleCtrl call.)