Here is a basic example with
Reusing an instance
If you wan't to reuse an instance make sure
destroyOnClose is passed as false in
Complex example - Resolving show with custom value.
Following example shows how a value can be passed back to the caller function as a value of promise.