I am currently implementing custom state management in angular 4 based on the angular router, mostly without connecting to the router and disconnecting components based on routing events.
It works fine until I try to switch from a route with parameters to the same route with different parameters, then it will work.
This plunkr (see console) explains my situation. The transition from the "crisis center" to the "heroes" is in order, the transition from the "heroes" to the "hero 11" is good, the transition from "hero11" to "hero12" causes an error
TypeError: Cannot read property 'component' of null
I know that the router should work with the output, but I think it is strange that it partially works without it, so I’m not even sure that this can be considered an error or the desired behavior.
I am wondering if there is some kind of configuration parameter that would solve this particular situation, or should I just use a different routing library and avoid the angular router?
source
share