Modified to use a single Angular controller.