Simple example of how to use the Publish/Subscribe pattern to communicate between controllers and services in AngularJS.