Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control Modal from Service #1569

Closed
dbogdantech101 opened this issue Jan 27, 2017 · 3 comments
Closed

Control Modal from Service #1569

dbogdantech101 opened this issue Jan 27, 2017 · 3 comments

Comments

@dbogdantech101
Copy link

dbogdantech101 commented Jan 27, 2017

Not sure if this has been covered, but I'm hoping you can help:

I'm trying to control a Modal from a service. I know you have docs for controlling it from a it's parent component, but what if you wanted a larger service controlling it?

Ie.
A notification service

<my-header></my-header>
<my-notification></my-notification>
<router-outlet></router-outlet>
<my-footer></my-footer>

where every other component could use a service to control the my-notification component?

I haven't been able to find a way to access the modal inside my-notification from another component, any thoughts?

@GuskiS
Copy link

GuskiS commented Jan 29, 2017

You should look into @ngrx/store. Idea is that you have a global holding place for what ever you want. In this example, when ever you need to show your modal window you tell the store, update it, and make sure modal window is listening (subscribed) to these changes. Hope this helps.

@valorkin
Copy link
Member

+1 to @GuskiS
and ModalService is a planned feature, which could help you a lot

@valorkin
Copy link
Member

closing as a duplicate of #579
will be starting to implementing this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants