This code is part of a tutorial on how to build a mobile app with the Ionic Framework. This app connects to the http://www.nerddinner.com website and let's the user log in and retrieve the list of dinners created by the user.
Here are the links for the tutorial:
Part 1 - Introduction to Hybrid Mobile Apps
Part 2 - Set Up your Development Environment
Part 3 - Mockup with Ionic Creator
Part 4 - Test on Browsers, Emulators and Mobile Devices
Part 5 - Build out the App
Part 6 - Deploy to Testers with Ionic View
I've also made tutorials for adding unit tests and end-to-end tests:
Part 1 - Introduction to Automated Testing & Frameworks
Part 2 - Unit Tests With Jasmine & Karma
Part 3 - End-To-End Tests With Jasmine & Protractor
For more tutorials on Ionic, check out my blog Gone Hybrid.