Angular 5 Routing can go to link by click but not by link

喜夏-厌秋 提交于 2019-12-24 19:23:41

问题


I'm a beginner having problem with Angular 5 Routing. I'm following this tutorial http://devarea.com/angular-5-routing-practical-guide/ Also tried some other tutorials and the result is the same. I'm on Windows 7 64 bit.

When I click the link, say, "books", it goes to the correct page showing "localhost:4200/books", but if I enter exactly that or refresh the page, it shows "Cannot GET /books".

Is this a bug? I made sure to read the tutorials over and over again.

UPDATE: I was using Firefox 52.5.3 ESR, then I tried accessing the page with Opera and it works, which is weird.

来源:https://stackoverflow.com/questions/49684814/angular-5-routing-can-go-to-link-by-click-but-not-by-link

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!