Chapter 4 code example for Ionic in Action