I am facing an issue with my Angular.js website that is filled with a multitude of widgets. Each widget consists of a template.html file paired with a controller.js file to form an angular module.
These widgets are utilized on a dashboard where users have the ability to rearrange them, and they may also need to appear in modal popups. Additionally, other tools may want to integrate with our site by pulling these widgets into their own platforms.
Currently, we have a total of 26 modals set up, with more being added regularly.
I'm looking for a way to create modals dynamically so I don't have to manually include them on every page. Is there a method to make these modals global? Furthermore, I need to be able to load a widget (template and controller) into the module, as all modules follow the same structure but may require customized headers, bodies, and footers.
Typically, I would convert these widgets into directives, but my team has already implemented them on the dashboard.
P.S. We are utilizing $stateProvider and Angular-UI Bootstrap modals for our project.