Showing basic use of Promises in Angularjs