Adding Star Ratings to Elements

In this example you will use just the AngularJS scope, controller, and view to implement elements that implement the star ratings for images. When you click on a star, the rating changes in the scope and the number of stars changes.

The purpose of this exercise is just to remind you that much of the data binding and view interactions can be accomplished in basic AngularJS templates without the need for custom directives.

The folder structure for this example is as follows:

./server.js: Node.js web server that serves the static project files.

./images: Folder that contains the images used in the examples.

./ch11: Project folder.

./ch11/rating.html: AngularJS template for the project that implements a simple ...

Get Learning AngularJS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.