angular-hybrid icon indicating copy to clipboard operation
angular-hybrid copied to clipboard

Can't set useHash to true in UIRouterUpgradeModule.forRoot

Open roypeled opened this issue 6 years ago • 2 comments

For some reason, we can't use the useHash property of UIRouterModule in UIRouterUpgradeModule.

The UIRouterModule.forRoot expect an interface of RootModule which supports useHash, while UIRouterUpgradeModule.forRoot expects an interface of NgHybridStatesModule which extends StatesModule and does not support useHash

roypeled avatar Dec 16 '18 14:12 roypeled

Temporary solution is to manually provide the location strategy to the app. In your root module add the following:

import { LocationStrategy, HashLocationStrategy } from '@angular/common';

@NgModule({
	...,
	providers: [
		{
			provide: LocationStrategy,
			useClass: HashLocationStrategy,
		},
	],
})

roypeled avatar Dec 16 '18 16:12 roypeled

Hi @roypeled , If the above solution helped , Can you please your the solution that will be very kind of you . I am not able to do deep linking in Angular AngularJS Hybrid App using UI RouterUpgradeModule

ghous92 avatar Dec 18 '20 09:12 ghous92

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. This does not mean that the issue is invalid. Valid issues may be reopened. Thank you for your contributions.

stale[bot] avatar Nov 12 '22 11:11 stale[bot]