dwmkerr / angular-modal-service

Modal service for AngularJS - supports creating popups and modals via a service.
MIT License
626 stars 321 forks source link

Pass inputs as `inputs` to Controller vs extending inputs object #229

Closed mloffer closed 3 years ago

mloffer commented 6 years ago

Currently, the user-defined options.inputs object is extended over the inputs object used by the service to inject dependencies into the controller. However, this means each input must be declared explicitly in the controller definition. If a defined input is then left out, angular throws an error since the injected variable is undefined.

Use case: I want to use default language within the modal controller, but allow an override in specific cases. The only way to get around this is to pass each defined input as null.

I propose that the inputs be passed in one object to the controller to simplify the interface.