-
Notifications
You must be signed in to change notification settings - Fork 24.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[es6 only] Cannot read property 'onPopState' of undefined #24592
Comments
@trotyl what is wrong with it ? |
What you provided cannot be reproduced via Angular CLI. Please provide an concrete GitHub Repo for the minimal reproduction based on brand new Angular CLI project. |
@trotyl I will add it. The reason I didn't add it before is because I thought it was very easy to reproduce it with the instructions that I've already give. Like I said last time, I don't think it's nice to just downvoting issues without specifying the reason. |
OK, duplicate of #24014, you can try For workaround, manually specifies the dependencies could help: @Injectable()
export class CustomLocationStrategy extends HashLocationStrategy {
constructor(
_platformLocation: PlatformLocation,
@Optional() @Inject(APP_BASE_HREF) _baseHref?: string,
) {
super(_platformLocation, _baseHref);
}
} |
It looks like this can be closed based on being a duplicate of #24014. @ShinDarth if you're experiencing something else, please give details with the repro. Otherwise I'll go ahead and close this in the next 24 hours and #24014 can be tracked for the fix. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a...
Having the following class:
used in my
app.module.ts
as provider:Current behavior
If (and only if) in the
tsconfig.json
the "target" is set to be "es6", I get the following error when running my application:Expected behavior
It should just work (it works fine when compiling to es5).
Minimal reproduction of the problem with instructions
Just create an empty class extending
HashLocationStrategy
and use it as aLocationStrategy
provider like showed above.What is the motivation / use case for changing the behavior?
Changing target from es5 to es6 should not break the application.
Environment
The text was updated successfully, but these errors were encountered: