A short example of how angular promise works