How to configure deeplinks in AppModule.forRoot()?

So, what the hell are we supposed to use?

If I add <base href="/"> to my index.html, I break mobile builds.
If I remove it, I break browser/desktop builds.

How are we supposed to handle this???

EDIT

Ok, spoke too soon.

They key is to remove the base from the index.html.
Also, we need to import import { APP_BASE_HREF } from '@angular/common'; on our app module.

Finally, we need to add this to our providers section on the module:
{provide: APP_BASE_HREF, useValue: '/'},

However…
This breaks the ability of the mobile application to fetch resources from the app (icons, images, etc).

Resuming, the state of the art in terms of Deeplinking and PathLocation strategies is broken… very, very broken

1 Like