A
A
Alexey ZloDeeV2017-05-26 21:48:31
JavaScript
Alexey ZloDeeV, 2017-05-26 21:48:31

How to make a popup in a separate router-outlet?

There are two components: a table with rows (parent) and a popup (child). By clicking on the line, a popup opens where data is loaded for editing. Editing/saving takes place in the popup, after closing it, you need to update the table.
Initially, I made a pop-up in the forehead, through * ngIf opening and closing, and with a simple emitter, threw changes into the parent component and updated the table in which these same lines edited in the pop-up were located.
The idea came to put the popup component in a separate router-outlet. I know how to write the part with the opening, but how to tell the table component that there have been changes in the neighboring outlet - I can’t imagine. Is
this how they do it at all? If through a service, then how to track changes in another component.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nicholas, 2017-05-26
@healqq

I think it's worth making a service with rx/observable, or pass the data for the table through the binding from the service and then it will be possible to catch the change in onChanges

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question