I think this is something I am doing wrong, but I don't know what. I want routing in my Angular web component, and I can get routing to work. However the components used in the routing outlet don't work correctly if I use a resolver. The Events aren't firing!
Or at least... They fire if you navigate to this route from another route in the application, for example, going from myWebsite.com/#/ to myWebsite.com/#/myRoute/myParameter works fine, the resolver gets the data and all the events fire as expected. However, if I press refresh while on this route or I try to paste the URL (myWebsite.com/#/myRoute/myParameter) directly into a new tab/browser the component renders, the constructor is called, but no events fire!
This only happens if I add a resolver. If i remove the resolver and add a console.log in each lifecycle event they all work every time! Is there something I can configure differently? Is this a bug?
Or is there a way I can get my data from an API which forces the events to wait, thus bypassing the need for a resolver. I need the data before the component tries to render as the form is dynamic - and all the form questions are coming from that API call. I've tried calling the service method in the ngOninit and constructor by subscribing to it, but it gets the data after all the events have fired and I just have a blank form.
Thanks!