S
S
sdgroup142019-05-24 14:43:45
Angular
sdgroup14, 2019-05-24 14:43:45

Why doesn't location subscribe work and why can't I do window.history.replaceState()?

Hello!
I'm trying to push an object into the browser history so that I can use it with popstate.
Found 2 methods - window.history.replaceState and from Angular location.replaceState .
None of these methods work correctly:
Actually window.history.replaceState, they don't work at all. Each time it resets the state and pushes its navigationId values , and deletes mine.
Clocation.replaceStatea little ambiguous, it fires events not in the desired component, but in the previous or next one. Below is an example with code, but as I understand it, it does not go there, but resets the pages. On LAN, when you switch from About to Main, nothing happens at all. It works only if you do not unsubscribe, but in this case you can subscribe 100 times, which is not correct. Also, rxjs operators like takeUntilor do not work take(1).
Any ideas what it could be? Bug? Link .

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question