Chapter 4 of the Angular JS book