added a more DRY way to create dialogs from JavaScript/TypeScript which removes lots of noise from the controllers (especially if you have a few dialogs)