Asynchronous event chaining for AngularJS