- Published: Friday, 17 April 2015 22:43
- Written by Alex Lopez
- Hits: 3534
Dialog boxes (AKA: Modals) Are an integral part of UI and UX design. Unfortunately, they can make your code messy when you have to deal with a large number of them and most libraries that provide easy to use dialog boxes do not always make it obvious how to make them more reusable. Below I will provide an example and explanation of using Angular Material's dialog service in a factory to have a single instantiator for all of your dialog needs.
You can find the documentation for angular-material project here.
You can find more documentation on AngularJS here.
I won't go over installing Angular and Material, if you are familiar with Bower or NPM you can easily retrieve the packages.