I'm submitting a...
[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report
[X] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
When I tried refreshing a route (example http://localhost:5000/profile) it goes to default fallback page. However I face this issue only after ng build. While developing when I use ng serve this works fine.
Expected behavior
After ng build when angular & node both are working together on same port.
Page refresh should not take to the default fallback page which is sent by node, instead it should stay where it was.
Minimal reproduction of the problem with instructions
- Create an angular app with a route apart from home route ( say '/profile').
- Create a link to '/profile' path in home component in Angular.
- Create a node app which will serve /public/index.html as home-route as well as default fallback(I mean when path is not matched with any of existing routes)
- run ng build from Angular source folder path on command prompt/terminal. (after 'ng build' output should go to <nodeapp folder>/public. to achieve this you should change outDir in .angular-cli.json to <nodeapp folder>/public)
- Run the node app, go to home, then navigate to profile using link which is created in step 2.
- Now try refreshing. Instead of staying at profile, it will go to home
What is the motivation / use case for changing the behavior?
Environment
Angular version: 5.2.8
Browser:
- [X] Chrome (desktop) version XX
- [X] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: XX
- Platform:
Others:
I think when I refresh the page the request is going to node (backend in my case). Shouldn't Angular be able to handle page refresh..? I mean if user is deep somewhere like http://domain/route1/id/route2 when refreshed he/she is forced to go to home page(default fallback page.)
If this is a bug consider this as an issue.
If this is intended behavior of Angular, kindly consider this as a feature request.
I'm submitting a...
Current behavior
When I tried refreshing a route (example http://localhost:5000/profile) it goes to default fallback page. However I face this issue only after ng build. While developing when I use ng serve this works fine.
Expected behavior
After ng build when angular & node both are working together on same port.
Page refresh should not take to the default fallback page which is sent by node, instead it should stay where it was.
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Environment
I think when I refresh the page the request is going to node (backend in my case). Shouldn't Angular be able to handle page refresh..? I mean if user is deep somewhere like http://domain/route1/id/route2 when refreshed he/she is forced to go to home page(default fallback page.)
If this is a bug consider this as an issue.
If this is intended behavior of Angular, kindly consider this as a feature request.