Emberjs Routing: Page reloads on every link click

孤街醉人 提交于 2019-12-13 23:29:42

问题


I have an Ember js app, with pushstate enabled. Say I am on a page www.xyz.com/start and I have proper link on the page (www.xyz.com/abc/def) and I have defined route in ember for /abc/def. But every time I click on the link, the page is reloaded instead of directly being served by the Ember router. What is the correct way to do this?


回答1:


You have to use the link-to helper instead of basic a href links.

{{#link-to 'abc/def'}}go to def{{/link-to}}

Where 'abc/def' is the route name.

See : http://emberjs.com/guides/templates/links/




回答2:


When you say a "proper link" do you mean an <a href> tag? If so, you should be using the {{link-to}} helper instead. See http://emberjs.com/guides/templates/links/



来源:https://stackoverflow.com/questions/27016241/emberjs-routing-page-reloads-on-every-link-click

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