Closed Tahiche closed 6 years ago
Seems like a reasonable request, i'll carve out some time.
My initial thinking is to make the defaultOptions an @injectable instead of a flat import and then it can be provided by you on a per module basis where ever you choose to import it.
{ provide: defaultSimpleModalOptions , useValue: <default here> }
Thoughts?
Injectable sounds like a good approach, I´m assuming you mean a ConfigService kind of thing that you can inject and thus override/modify.
If i´m not mistaken, here...
{ provide: defaultSimpleModalOptions , useValue: <default here> }
You´d be modifying/customizing default Options globally, at Module level?. That´s great, then you could further override if needed by injecting the service at specific components.
@Tahiche give that branch a look over. Feedback welcome.
I'm going to push this anyway @Tahiche but your feedback on it would be welcome since you initiated the request
Hi!, So sorry i missed these comments!. It looks great, thank u very much!!. I´ll check it out. Again, sorry for not answering before I wasn´t noticed and totally missed it.
Cheers!!
EDIT: My fist time messing with git branches and npm packages... It seems like the branch/change is not pushed to node right (current version 1.3.3) ?. Do you clone the branch on the "node_modules/ngx-simple-modal" folder?.
Hi, I want to have some global options for all modals, for example "closeOnEscape: true, closeOnClickOutside: true,". Don´t want to specify that on every .addModal() call, it seems redundant. I can´t see an obvious way to do this. These default options seem to be set in SimpleModalHolderComponent, so it looks like they can´t be overriden at extending component either.