Skip to content
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

Navigating to routes when useHash=false #1075

Closed
tr11 opened this issue Sep 30, 2016 · 3 comments
Closed

Navigating to routes when useHash=false #1075

tr11 opened this issue Sep 30, 2016 · 3 comments

Comments

@tr11
Copy link

tr11 commented Sep 30, 2016

Note: for support questions, please use one of these channels: Chat: AngularClass.slack or Twitter: @AngularClass

  • I'm submitting a ...
    [X ] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
  • What is the current behavior?

Disabling hash navigation and navigating to any route that is not the root route renders the following

<% if (webpackConfig.htmlElements.headTags) { %> <%= webpackConfig.htmlElements.headTags %> <% } %> Loading... <% if (webpackConfig.metadata.isDevServer && webpackConfig.metadata.HMR !== true) { %> <% } %>

This only happens using the dev server. Production builds work as expected. This seems to be the same or very similar to issue #762, which was marked as closed.

Change on src/app/app.module.ts:50:
RouterModule.forRoot(ROUTES, { useHash: true })
to
RouterModule.forRoot(ROUTES, { useHash: false })

  • What is the expected behavior?

Expectation is that we navigate to the correct route (e.g. http://localhost:3000/home)

  • Please tell us about your environment:
  • Angular version: 2.0.0
  • Browser: Chrome
@Kamalswami
Copy link

I am facing same issue....

@nekkon
Copy link

nekkon commented Oct 4, 2016

The solution to #1056 did not solve the problem either. Tried removing all ^ from package.json, didn't work either.

@tr11
Copy link
Author

tr11 commented Oct 4, 2016

@nekkon, thanks for pointing out the other issue -- I'll close this one as the problem is exactly the same as described there. Using the suggestion on #1056 issue worked for me: "webpack-dev-server": ">=2.1.0-beta.6" seems to break the useHash: false option.

@tr11 tr11 closed this as completed Oct 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants