-
Notifications
You must be signed in to change notification settings - Fork 1.4k
open modal/aside at a certain state with ui-router #1735
Comments
Have a look at this plunker, it makes use of a custom modal service to make it easier to define what to do when a button is pressed: From looking at ui-router sample, it looks like it could work the same way as for ui-bootstrap. |
@vmlf01 thanks for your example, I've tried similar solution but still no luck, I've using this kind of custom modal service in state's I don't know why but seems your example only works well in an existing controller, since ui-bootstrap's modal provide its own controller, we don't need to create a controller for state. I can't say this is the key but I guess so... could you take a little time to try your solution with ui-router please? thank you in advance. |
@vmlf01 Thank you, finally I've figured out how to do this, however it is almost useless when using ngStrap's modal/aside. Why I need a new state with modal/aside? because I need a new state to manage more complex business logic with modal/aside, I need to split these kinds of logic when a modal/aside evolves, which means not only a modal/aside directive w/o service is needed, but also a controller/resolve mechanism is necessary to handle this sort of situation. This is what ui-bootstap's modal does but ngStrap modal/aside don't. I can open modals/asides when corresponding states changed, but I can't provide alongside logic for each of them, unless to write multiple wrapper services for every instance, that's insane. I compared the source code between ui-bootstrap's and ngStrap's implement, found out it is very hard to customize a service to archive the same purpose in this case, but I really think this is useful for everyone. Anyway, thanks again @vmlf01 I've learned a lot from your example, for now I can't find any better way to improve this. |
Finally took the time to backport the |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Here's example that ui-router provides us to demonstrate how to open a modal (using ui-bootstrap) at a certain state other than swapping out ui-view(s):
https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions#how-to-open-a-dialogmodal-at-a-certain-state
I want to archive the same goal when using angular-strap, but can't find a working way, anyone knows any working solution?
The text was updated successfully, but these errors were encountered: