0

I want to develop web-component based on angular elements, which will be integrated into non-angular application. Is there any proper way for this web-component to use routing?

I need it because web-component will contain views for creating/viewing list/viewing details/viewing settings of some entity (article).

This routing, as I see it, should not affect primary routing of main application. I was thinking about creating it based on names router outlets, but it involves adding some dirty hack fixes.

  • What problem are you facing with that? – Vimal Patel Jan 29 '21 at 13:20
  • Well, if we are talking about router outlets - it throws an error for unmatch url segment after first navigation. In this article you can find a fix for that issue :https://medium.com/@timon.grassl/how-to-use-routing-in-angular-web-components-c6a76449cdb, but it's working only when you use web-component in a scope of other angular application. – robert_madino Jan 29 '21 at 14:16
  • To be specific, I'm looking for a proper example of creating routing for web-component in a scope of non-angular application.\ – robert_madino Jan 29 '21 at 14:17
  • so you want a complete component which is using router-outlet in it and you want to export that component as webcomponent.Correct? – Vimal Patel Jan 29 '21 at 14:23
  • Yeah. Plus it should work in non-angular app, don't affect primary app routing. – robert_madino Jan 29 '21 at 14:25
  • Primary app wont be affected at all as for publishing web-component you need to create another module and bootstrap them separately so it wont affect your main application. – Vimal Patel Jan 29 '21 at 14:30
  • well, it does not work this way for me. can you create some example, please? – robert_madino Jan 29 '21 at 14:43
  • what does not work web-component or your main application? – Vimal Patel Jan 29 '21 at 14:50
  • anyone found a solution for this? – Andy P Apr 11 '22 at 12:46

0 Answers0