0

I'm working on a project that's an Angular7 project. We want to load routing values from a json which is requested from an app(SAAS server identity-authorization management). I was digging a lot of place but I couldn't find any example. Can I fill routing values from a json file or a service at runtime?

By the way, if it's not a suitable way for Angular

Thank you...

Mumin Ka
  • 725
  • 9
  • 19
  • Is it the complete Router Config that you want to load? – SiddAjmera Jul 02 '19 at 10:28
  • you con do it this way: https://stackoverflow.com/questions/53580756/angular6-synchronously-load-route-data – Mazdak Jul 02 '19 at 10:39
  • @SiddAjmera yeap – Mumin Ka Jul 02 '19 at 11:44
  • @Mazdak dude you misunderstood me. I don't want to transform json file or data to an object. I want to load routing values from the server – Mumin Ka Jul 02 '19 at 11:45
  • @MuminKa see the second answer which accepted as the answer, in `app-routing.module.ts` they pass any incoming route request to resolve with `resolve()` method in `resolver.service.ts`. there they get routing values from server and resolve routes based on that data. also they used that data in `content.component.ts` or `navbar.component.ts` to create links based on data. isn't that what you want? – Mazdak Jul 03 '19 at 09:39

1 Answers1

0

As I understand, this is not a valid approach on angular side. So I will implement static routing. Thank you for all.

Mumin Ka
  • 725
  • 9
  • 19