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

feat(app): Add default routing to index.html to allow for refresh on HTML5 routes #17

Closed
DaftMonk opened this issue Nov 21, 2013 · 0 comments

Comments

@DaftMonk
Copy link
Member

Angular's HTML5 mode overrides the default routing, so routes that appear valid only exist when you visit them after initializing the app.

This means if I were to set up an angular route called /about and tried going to localhost, then clicking on a link to /about, everything would work. But if I tried refreshing once I was on the localhost/about page, or going directly to localhost/about I would get a 404.

To fix this I will set all unspecified server routes to go to index.html. This will also require a rendering engine such as EJS to render the html page on request.

DaftMonk added a commit that referenced this issue Nov 22, 2013
Server now uses EJS rendering to serve html views. New structure should allow Jade support later on. Additionally, HTML5 mode is now supported. All un-specified server routes now redirect to index so the angular routing system handles them.

BREAKING CHANGE:

angular-fullstack:route and angular-fullstack:view  will now generate views and routes in the views/partials folder.

For existing projects:

Please install generator-angular and use it's subgenerators for creating routes and views. They are exactly the same as the generators that you have been using. Example usage: yo angular:route helloworld.

For New projects:

Continue to use angular-fullstack route and view subgenerators.

The reason for this change in folder structure was to support server page rendering.

Closes #18, #17
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

1 participant