This is example to demonstrate how to implement promise chaining in AngularJS