angular / router

The Angular 1 Component Router
MIT License
665 stars 135 forks source link

Using hash in IE 11 and Microsoft Edge 41 when routing #438

Open chigivigi opened 6 years ago

chigivigi commented 6 years ago

I made a single page application that uses angular version 5.2.3 and adal authentication. My routing is set to have hash inside it and that works fine when using it in Google Chrome but it does not work in IE and Edge. Once I remove hash from routes configuration, it starts working in IE and Edge but I do not want to use routing without hash. Is there a way to have hash in routes when used in IE and Edge ?

code snippet for setting routes in my controller const appRoutes: Routes = [ { path : 'Apps', loadChildren: './main/content/apps/apps.module#AppsModule' }, { path : '**', redirectTo: 'Apps/Load' } ]; @NgModule({ imports : [ RouterModule.forRoot(appRoutes, {useHash: true}) ] })

code snippet for setting adal: package.json: dependencies: "@types/adal": "^1.0.29"

adal.service.ts: export class AdalService { private _config: adal.Config; private _context: adal.AuthenticationContext; constructor() { this._config = { tenant: environment.tenant, clientId: environment.AppId, redirectUri: window.location.origin + '/', postLogoutRedirectUri: window.location.origin + '/', endpoints: environment.endpoints, cacheLocation: environment.cacheLocation }; this._context = new AuthenticationContext(this._config); } }

apps page login: this.adalService.context.login();