Added promises that are resolved when the menu is closed.

This is a small feature that I needed for a project that I am working on.
Here are my results; hopefully they can be useful to someone else!
This assertions are duplicated. Besides that, it doesn't really exercise the code to see if there's a promise here. You can use the ```$q``` service to help.